From 01fb245da32fba89477ee37bf53f7ad1f37b113a Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Sun, 4 Nov 2012 15:54:22 -0800 Subject: [PATCH 1/4] Fixing double drops for herbalism so that carrots and potatoes drop items instead of blocks. --- .../java/com/gmail/nossr50/skills/gathering/Herbalism.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java index ee5f9e014..75676c215 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java @@ -237,10 +237,10 @@ public class Herbalism { if (mat == Material.COCOA) { is = new ItemStack(Material.INK_SACK, 1, (short) 3); } - else if (mat == Material.COCOA) { + else if (mat == Material.CARROT) { is = new ItemStack(Material.CARROT_ITEM, 1, (short) 0); } - else if (mat == Material.COCOA) { + else if (mat == Material.POTATO) { is = new ItemStack(Material.POTATO_ITEM, 1, (short) 0); } From c7b3b7a8263633f87690b7972e08091887291064 Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Sun, 4 Nov 2012 16:06:33 -0800 Subject: [PATCH 2/4] Green thumb now converts cobble walls to mossy cobble walls. --- src/main/java/com/gmail/nossr50/config/Config.java | 1 + .../java/com/gmail/nossr50/skills/gathering/Herbalism.java | 3 +++ src/main/java/com/gmail/nossr50/util/BlockChecks.java | 1 + src/main/resources/config.yml | 1 + 4 files changed, 6 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index a4189dadd..8554d5f78 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -169,6 +169,7 @@ public class Config extends ConfigLoader { public int getHerbalismXPPotato() { return config.getInt("Experience.Herbalism.Potato", 50); } public boolean getHerbalismGreenThumbCobbleToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); } + public boolean getHerbalismGreenThumbCobbleWallToMossyWall() { return config.getBoolean("Skills.Herbalism.Green_Thumb.CobbleWall_To_MossyWall", true); } public boolean getHerbalismGreenThumbSmoothbrickToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true); } public boolean getHerbalismGreenThumbDirtToGrass() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Dirt_To_Grass", true); } diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java index 75676c215..ebf2b216d 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java @@ -65,6 +65,9 @@ public class Herbalism { // Don't award double drops to mossified cobblestone mcMMO.placeStore.setTrue(block); } + else if (Config.getInstance().getHerbalismGreenThumbCobbleWallToMossyWall() && type == Material.COBBLESTONE) { + block.setData((byte) 1); + } } } diff --git a/src/main/java/com/gmail/nossr50/util/BlockChecks.java b/src/main/java/com/gmail/nossr50/util/BlockChecks.java index 6b2128ade..82b055eeb 100644 --- a/src/main/java/com/gmail/nossr50/util/BlockChecks.java +++ b/src/main/java/com/gmail/nossr50/util/BlockChecks.java @@ -154,6 +154,7 @@ public class BlockChecks { case DIRT: return true; case SMOOTH_BRICK: + case COBBLE_WALL: if (block.getData() == 0) { return true; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 625d75df9..d731a4e61 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -151,6 +151,7 @@ Skills: Level_Cap: 0 Green_Thumb: Cobble_To_Mossy: true + CobbleWall_To_MossyWall: true SmoothBrick_To_MossyBrick: true Dirt_To_Grass: true Mining: From f4cb83319e7e09a18661ee727fc2af9b27e655da Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Sun, 4 Nov 2012 16:39:06 -0800 Subject: [PATCH 3/4] Fixes an NPE involving certain explosions. --- src/main/java/com/gmail/nossr50/listeners/EntityListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 035a76e61..739099d4c 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -229,10 +229,12 @@ public class EntityListener implements Listener { @EventHandler (priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEnitityExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); + + if(entity == null) return; if(entity.hasMetadata("NPC")) return; // Check if this player is a Citizens NPC - if (event.getEntity() instanceof TNTPrimed) { + if (entity instanceof TNTPrimed) { int id = entity.getEntityId(); if (plugin.tntIsTracked(id)) { From 91a18fe7a2ce8edcf006bac365a355019b0ef1e5 Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Sun, 4 Nov 2012 21:47:15 -0800 Subject: [PATCH 4/4] Fixing herbalism to look for cobble walls when trying to convert cobble walls. --- src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java index ebf2b216d..303cdad1c 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java @@ -65,7 +65,7 @@ public class Herbalism { // Don't award double drops to mossified cobblestone mcMMO.placeStore.setTrue(block); } - else if (Config.getInstance().getHerbalismGreenThumbCobbleWallToMossyWall() && type == Material.COBBLESTONE) { + else if (Config.getInstance().getHerbalismGreenThumbCobbleWallToMossyWall() && type == Material.COBBLE_WALL) { block.setData((byte) 1); } }