From 0e2746622d5e81ef0843a673ff83f61e45ebe9c1 Mon Sep 17 00:00:00 2001 From: bm01 Date: Fri, 8 Mar 2013 19:33:03 +0100 Subject: [PATCH] Fixed the Cacti & Sugar Cane fix! --- .../java/com/gmail/nossr50/skills/herbalism/Herbalism.java | 7 +++++-- .../gmail/nossr50/skills/herbalism/HerbalismManager.java | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java index 1875fe05c..317feb539 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java @@ -63,7 +63,7 @@ public class Herbalism { protected static int calculateCatciAndSugarDrops(BlockState blockState) { Block block = blockState.getBlock(); Material blockType = blockState.getType(); - int dropAmount = 1; + int dropAmount = mcMMO.placeStore.isTrue(block) ? 0 : 1; // Handle the two blocks above it - cacti & sugar cane can only grow 3 high naturally for (int y = 1; y < 3; y++) { @@ -73,7 +73,10 @@ public class Herbalism { break; } - if (!mcMMO.placeStore.isTrue(relativeBlock)) { + if (mcMMO.placeStore.isTrue(relativeBlock)) { + mcMMO.placeStore.setFalse(relativeBlock); + } + else { dropAmount++; } } diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index ea90412c9..27b4e33ee 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -114,8 +114,9 @@ public class HerbalismManager extends SkillManager { */ public void herbalismBlockCheck(BlockState blockState) { Material material = blockState.getType(); + boolean oneBlockPlant = (material == Material.CACTUS || material == Material.SUGAR_CANE_BLOCK) ? false : true; - if (mcMMO.placeStore.isTrue(blockState) && (material != Material.CACTUS || material != Material.SUGAR_CANE_BLOCK)) { + if (oneBlockPlant && mcMMO.placeStore.isTrue(blockState)) { return; } @@ -136,7 +137,7 @@ public class HerbalismManager extends SkillManager { drop = herbalismBlock.getDropItem(); } - if (material == Material.CACTUS || material == Material.SUGAR_CANE_BLOCK) { + if (!oneBlockPlant) { amount = Herbalism.calculateCatciAndSugarDrops(blockState); xp *= amount; }