From 5d55af81836f3cc7d82a2c059be63b189471dd03 Mon Sep 17 00:00:00 2001 From: GJ Date: Sat, 10 Mar 2012 00:20:43 -0500 Subject: [PATCH] Fixed Green Terra not working. --- .../com/gmail/nossr50/listeners/mcBlockListener.java | 3 ++- .../java/com/gmail/nossr50/skills/Herbalism.java | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java index 8413e110a..cfaeca905 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java @@ -229,9 +229,10 @@ public class mcBlockListener implements Listener { /* * ABILITY TRIGGER CHECKS */ - if (PP.getGreenTerraMode() && Skills.triggerCheck(player, block, AbilityType.GREEN_TERRA)) { + if (PP.getGreenTerraMode() && mcPermissions.getInstance().herbalismAbility(player)) { Herbalism.greenTerra(player, block); } + if (PP.getGigaDrillBreakerMode() && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) { if (LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand)) { event.setInstaBreak(true); diff --git a/src/main/java/com/gmail/nossr50/skills/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/Herbalism.java index a87b27a7d..36a788dc3 100644 --- a/src/main/java/com/gmail/nossr50/skills/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/Herbalism.java @@ -22,18 +22,18 @@ public class Herbalism public static void greenTerra(Player player, Block block){ PlayerInventory inventory = player.getInventory(); boolean hasSeeds = inventory.contains(Material.SEEDS); - if(block.getType() == Material.COBBLESTONE || block.getType() == Material.DIRT || block.getType() == Material.SMOOTH_BRICK){ + if(block.getType().equals(Material.COBBLESTONE) || block.getType().equals(Material.DIRT) || block.getType().equals(Material.SMOOTH_BRICK)){ if(!hasSeeds) player.sendMessage("You need more seeds to spread Green Terra"); - if(hasSeeds && block.getType() != Material.WHEAT) + if(hasSeeds && !block.getType().equals(Material.WHEAT)) { inventory.removeItem(new ItemStack(Material.SEEDS, 1)); player.updateInventory(); - if(LoadProperties.enableSmoothToMossy && block.getType() == Material.SMOOTH_BRICK) - block.setData((byte)1); - if(LoadProperties.enableDirtToGrass && block.getType() == Material.DIRT) + if(LoadProperties.enableSmoothToMossy && block.getType().equals(Material.SMOOTH_BRICK)) + block.setData((byte) 0x1); + if(LoadProperties.enableDirtToGrass && block.getType().equals(Material.DIRT)) block.setType(Material.GRASS); - if(LoadProperties.enableCobbleToMossy && block.getType() == Material.COBBLESTONE) + if(LoadProperties.enableCobbleToMossy && block.getType().equals(Material.COBBLESTONE)) block.setType(Material.MOSSY_COBBLESTONE); } }