From a35af4dbe6b0d3842c145cb2144690416ff60f52 Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 25 Jan 2013 10:41:43 -0500 Subject: [PATCH] This is better & cleaner than just comparing the data. --- .../com/gmail/nossr50/skills/herbalism/Herbalism.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 70b647b14..6feb93e63 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java @@ -10,6 +10,8 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; +import org.bukkit.material.CocoaPlant; +import org.bukkit.material.CocoaPlant.CocoaPlantSize; import org.bukkit.material.MaterialData; import com.gmail.nossr50.mcMMO; @@ -227,10 +229,11 @@ public class Herbalism { break; case COCOA: - if (((data) & 0x8) == 0x8) { - mat = Material.COCOA; - xp = Config.getInstance().getHerbalismXPCocoa(); + CocoaPlant plant = (CocoaPlant) block.getState().getData(); + if (plant.getSize() == CocoaPlantSize.LARGE) { + mat = type; + xp = Config.getInstance().getHerbalismXPCocoa(); if (Permissions.greenThumbCocoa(player)) { greenThumbWheat(block, player, event, plugin);