This is better & cleaner than just comparing the data.

This commit is contained in:
GJ 2013-01-25 10:41:43 -05:00
parent 329f779781
commit a35af4dbe6

View File

@ -10,6 +10,8 @@ import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.PlayerInventory;
import org.bukkit.material.CocoaPlant;
import org.bukkit.material.CocoaPlant.CocoaPlantSize;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
@ -227,10 +229,11 @@ public class Herbalism {
break; break;
case COCOA: case COCOA:
if (((data) & 0x8) == 0x8) { CocoaPlant plant = (CocoaPlant) block.getState().getData();
mat = Material.COCOA;
xp = Config.getInstance().getHerbalismXPCocoa();
if (plant.getSize() == CocoaPlantSize.LARGE) {
mat = type;
xp = Config.getInstance().getHerbalismXPCocoa();
if (Permissions.greenThumbCocoa(player)) { if (Permissions.greenThumbCocoa(player)) {
greenThumbWheat(block, player, event, plugin); greenThumbWheat(block, player, event, plugin);