From 55f48764fe8088062331944de62c9e2be3a35ecc Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 7 Dec 2010 20:02:12 -0800 Subject: [PATCH 1/3] First version of fire antigriefs. --- vMinecraft.java | 1 + vMinecraftSettings.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/vMinecraft.java b/vMinecraft.java index 65bb1fdc8..e2dae50ba 100644 --- a/vMinecraft.java +++ b/vMinecraft.java @@ -28,6 +28,7 @@ public class vMinecraft extends Plugin { etc.getLoader().addListener(PluginLoader.Hook.IGNITE, listener, this, PluginListener.Priority.HIGH); etc.getLoader().addListener(PluginLoader.Hook.DAMAGE, listener, this, PluginListener.Priority.MEDIUM); etc.getLoader().addListener(PluginLoader.Hook.EXPLODE, listener, this, PluginListener.Priority.HIGH); + etc.getLoader().addListener(PluginLoader.Hook.LIQUID_DESTROY, listener, this, PluginListener.Priority.MEDIUM); etc.getLoader().addListener(PluginLoader.Hook.HEALTH_CHANGE, listener, this, PluginListener.Priority.MEDIUM); } } diff --git a/vMinecraftSettings.java b/vMinecraftSettings.java index 9679f1910..ccc60d003 100644 --- a/vMinecraftSettings.java +++ b/vMinecraftSettings.java @@ -40,6 +40,8 @@ public class vMinecraftSettings { static ArrayList ezModo = new ArrayList(); //An array of players currently toggled for admin chat static ArrayList adminChatList = new ArrayList(); + //An array of blocks that won't catch on fire + static ArrayList fireNoSpread = new ArrayList(); private PropertiesFile properties; @@ -88,6 +90,8 @@ public class vMinecraftSettings { writer.write("#The health ezmodo people will have while in ezmodo. Don't set to 0\r\n"); writer.write("ezHealth=30\r\n"); writer.write("stopFire=false\r\n"); + writer.write("#Flame Immune blocks will never have fire spread to them, seperate with comma. Needs stopFire to be true\r\n"); + writer.write("fireNoSpread=5,17,18"); writer.write("stopTnt=false\r\n"); writer.write("rules=Rules@#1: No griefing@#2: No griefing\r\n"); writer.write("#Death messages, seperate them by comma. All death messages start with the player name and a space.\r\n"); @@ -137,7 +141,7 @@ public class vMinecraftSettings { stopTnt = properties.getBoolean("stopTNT",true); rules = properties.getString("rules", "").split("@"); deathMessages = properties.getString("deathmessages", "").split(","); - + fireNoSpread.add(properties.getString("fireNoSpread", "").split(",").toString()); String[] tempEz = properties.getString("ezModo").split(","); ezModo = new ArrayList(); for(String ezName : tempEz) From bfdbe3f6f928e285fd46a71cb2e83fd54c658eea Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 7 Dec 2010 20:08:40 -0800 Subject: [PATCH 2/3] First version of fire antigriefs... Forgot this file. --- vMinecraftListener.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vMinecraftListener.java b/vMinecraftListener.java index 25965391f..70459c811 100644 --- a/vMinecraftListener.java +++ b/vMinecraftListener.java @@ -90,6 +90,14 @@ public class vMinecraftListener extends PluginListener { public void onLogin(Player player){ vMinecraftUsers.addUser(player); } + public boolean onIgnite(Block block, Player player) { + if(vMinecraftSettings.stopFire){ + if (vMinecraftSettings.fireNoSpread.contains(block)){ + return true; + } + } + return false; + } public boolean onDamage(PluginLoader.DamageType type, BaseEntity attacker, BaseEntity defender, int amount) { if(defender.isPlayer()){ Player player = (Player)defender; From 914ef8e8d0650e04ae3955a054ee226db2e96358 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 7 Dec 2010 20:16:13 -0800 Subject: [PATCH 3/3] Fixed /modify command exploit again, still doesn't have a toggle though. --- vMinecraftCommands.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vMinecraftCommands.java b/vMinecraftCommands.java index b218cca64..83e80f516 100644 --- a/vMinecraftCommands.java +++ b/vMinecraftCommands.java @@ -585,8 +585,9 @@ public class vMinecraftCommands{ public static int modifySplit(Player player, String[] args) { //Exploit fix for people giving themselves commands - if(args[1].equals("commands")) - return EXIT_SUCCESS; + if(args[2].equals("commands")){ + return EXIT_FAIL; + } return EXIT_CONTINUE; }