diff --git a/TODO b/TODO index de209a627..c13ac864a 100644 --- a/TODO +++ b/TODO @@ -6,4 +6,5 @@ Bukkit TODO -vGuilds for the guild and party system (noss) -vGroups for the groups system (Cere) -Finish up the hMod planned features --Include updatr support with the new plugins \ No newline at end of file +-Include updatr support with the new plugins +-Port as many of vMinecrafts features as possible \ No newline at end of file diff --git a/vStopFire/com/bukkit/nossr50/vStopFire/vBlockListener.java b/vStopFire/com/bukkit/nossr50/vStopFire/vBlockListener.java new file mode 100644 index 000000000..4562c7234 --- /dev/null +++ b/vStopFire/com/bukkit/nossr50/vStopFire/vBlockListener.java @@ -0,0 +1,30 @@ +package com.bukkit.nossr50.vStopFire; + +import org.bukkit.Block; +import org.bukkit.BlockFace; +import org.bukkit.Material; +import org.bukkit.event.block.BlockCanBuildEvent; +import org.bukkit.event.block.BlockIgniteEvent; +import org.bukkit.event.block.BlockListener; +import org.bukkit.event.block.BlockPhysicsEvent; + +/** + * vPlayerSpawn block listener + * @author nossr50 + */ +public class vBlockListener extends BlockListener { + private final vStopFire plugin; + + public vBlockListener(final vStopFire plugin) { + this.plugin = plugin; + } + //This should stop fire from spreading but still allow players to light stuff up with flint and steel + public void onBlockIgnite(BlockIgniteEvent event) { + String cause = event.getCause().toString(); + if(cause.equals("SPREAD")) + event.setCancelled(true); + if(!cause.equals("FLINT_AND_STEEL")) + event.setCancelled(true); + } + //put all Block related code here +} diff --git a/vStopFire/com/bukkit/nossr50/vStopFire/vPlayerListener.java b/vStopFire/com/bukkit/nossr50/vStopFire/vPlayerListener.java new file mode 100644 index 000000000..7fc08197a --- /dev/null +++ b/vStopFire/com/bukkit/nossr50/vStopFire/vPlayerListener.java @@ -0,0 +1,24 @@ +package com.bukkit.nossr50.vStopFire; + +import org.bukkit.Location; +import org.bukkit.Player; +import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.event.player.PlayerListener; +import org.bukkit.event.player.PlayerMoveEvent; + +/** + * Handle events for all Player related events + * @author nossr50 + */ +public class vPlayerListener extends PlayerListener { + private final vStopFire plugin; + + public vPlayerListener(vStopFire instance) { + plugin = instance; + } + + + //Insert Player related code here +} + diff --git a/vStopFire/com/bukkit/nossr50/vStopFire/vStopFire.java b/vStopFire/com/bukkit/nossr50/vStopFire/vStopFire.java new file mode 100644 index 000000000..ef18b9051 --- /dev/null +++ b/vStopFire/com/bukkit/nossr50/vStopFire/vStopFire.java @@ -0,0 +1,58 @@ +package com.bukkit.nossr50.vStopFire; + +import java.io.File; +import java.util.HashMap; +import org.bukkit.Player; +import org.bukkit.Server; +import org.bukkit.event.Event.Priority; +import org.bukkit.event.Event; +import org.bukkit.plugin.PluginDescriptionFile; +import org.bukkit.plugin.PluginLoader; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.plugin.PluginManager; + +/** + * vStopFire for Bukkit + * + * @author nossr50 + */ +public class vStopFire extends JavaPlugin { + private final vPlayerListener playerListener = new vPlayerListener(this); + private final vBlockListener blockListener = new vBlockListener(this); + private final HashMap debugees = new HashMap(); + private final String name = "vStopFire"; + + public vStopFire(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) { + super(pluginLoader, instance, desc, folder, plugin, cLoader); + + + // NOTE: Event registration should be done in onEnable not here as all events are unregistered when a plugin is disabled + } + + + + public void onEnable() { + getServer().getPluginManager().registerEvent(Event.Type.BLOCK_IGNITE, blockListener, Priority.Normal, this); + PluginDescriptionFile pdfFile = this.getDescription(); + System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" ); + } + public void onDisable() { + // TODO: Place any custom disable code here + + // NOTE: All registered events are automatically unregistered when a plugin is disabled + + // EXAMPLE: Custom code, here we just output some info so we can check all is well + System.out.println("Goodbye world!"); + } + public boolean isDebugging(final Player player) { + if (debugees.containsKey(player)) { + return debugees.get(player); + } else { + return false; + } + } + + public void setDebugging(final Player player, final boolean value) { + debugees.put(player, value); + } +} diff --git a/vStopFire/plugin.yml b/vStopFire/plugin.yml new file mode 100644 index 000000000..7406431fe --- /dev/null +++ b/vStopFire/plugin.yml @@ -0,0 +1,3 @@ +name: vStopFire +main: com.bukkit.nossr50.vStopFire.vStopFire +version: 1.0 \ No newline at end of file