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 821d955ab..d8538c683 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -5,12 +5,14 @@ import java.util.List; import org.bukkit.CropState; import org.bukkit.Material; +import org.bukkit.NetherWartsState; import org.bukkit.block.BlockState; import org.bukkit.entity.Player; 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.NetherWarts; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.config.Config; @@ -307,20 +309,22 @@ public class HerbalismManager extends SkillManager { return true; case NETHER_WARTS: + NetherWarts warts = (NetherWarts) blockState.getData(); + if (greenTerra) { - blockState.setRawData((byte) 2); + warts.setState(NetherWartsState.STAGE_TWO); } else { int greenThumbStage = getGreenThumbStage(); if (greenThumbStage > 2) { - blockState.setRawData((byte) 2); + warts.setState(NetherWartsState.STAGE_TWO); } else if (greenThumbStage == 2) { - blockState.setRawData((byte) 1); + warts.setState(NetherWartsState.STAGE_ONE); } else { - blockState.setRawData((byte) 0); + warts.setState(NetherWartsState.SEEDED); } } diff --git a/src/main/java/com/gmail/nossr50/util/BlockUtils.java b/src/main/java/com/gmail/nossr50/util/BlockUtils.java index 7d28fec56..5f43d585f 100644 --- a/src/main/java/com/gmail/nossr50/util/BlockUtils.java +++ b/src/main/java/com/gmail/nossr50/util/BlockUtils.java @@ -1,9 +1,11 @@ package com.gmail.nossr50.util; import org.bukkit.CropState; +import org.bukkit.NetherWartsState; import org.bukkit.block.BlockState; import org.bukkit.material.CocoaPlant; import org.bukkit.material.CocoaPlant.CocoaPlantSize; +import org.bukkit.material.NetherWarts; import com.gmail.nossr50.config.Config; @@ -62,7 +64,7 @@ public final class BlockUtils { return blockState.getRawData() == CropState.RIPE.getData(); case NETHER_WARTS: - return blockState.getRawData() == (byte) 0x3; + return ((NetherWarts) blockState.getData()).getState() == NetherWartsState.RIPE; case COCOA: return ((CocoaPlant) blockState.getData()).getSize() == CocoaPlantSize.LARGE; @@ -194,7 +196,7 @@ public final class BlockUtils { return blockState.getRawData() == CropState.RIPE.getData(); case NETHER_WARTS: - return blockState.getRawData() == (byte) 0x3; + return ((NetherWarts) blockState.getData()).getState() == NetherWartsState.RIPE; case COCOA: return ((CocoaPlant) blockState.getData()).getSize() == CocoaPlantSize.LARGE;