diff --git a/src/com/dre/brewery/BCauldron.java b/src/com/dre/brewery/BCauldron.java index 471b615..a5dc21f 100644 --- a/src/com/dre/brewery/BCauldron.java +++ b/src/com/dre/brewery/BCauldron.java @@ -35,7 +35,7 @@ public class BCauldron { public void onUpdate() { // Check if fire still alive - if (!Util.isChunkLoaded(block) || LegacyUtil.isFireForCauldron(block.getRelative(BlockFace.DOWN).getType())) { + if (!Util.isChunkLoaded(block) || LegacyUtil.isFireForCauldron(block.getRelative(BlockFace.DOWN))) { // add a minute to cooking time state++; if (someRemoved) { diff --git a/src/com/dre/brewery/LegacyUtil.java b/src/com/dre/brewery/LegacyUtil.java index adb2bfe..58129a3 100644 --- a/src/com/dre/brewery/LegacyUtil.java +++ b/src/com/dre/brewery/LegacyUtil.java @@ -105,8 +105,9 @@ public class LegacyUtil { return type.name().endsWith("SIGN") || (!P.use1_13 && type == SIGN_POST); } - public static boolean isFireForCauldron(Material type) { - return type != null && (type == Material.FIRE || type == CAMPFIRE || type == MAGMA_BLOCK || isLava(type)); + public static boolean isFireForCauldron(Block block) { + Material type = block.getType(); + return type != null && (type == Material.FIRE || type == MAGMA_BLOCK || litCampfire(block) || isLava(type)); } // LAVA and STATIONARY_LAVA are merged as of 1.13 @@ -114,6 +115,16 @@ public class LegacyUtil { return type == Material.LAVA || (!P.use1_13 && type == STATIONARY_LAVA); } + public static boolean litCampfire(Block block) { + if (block.getType() == CAMPFIRE) { + BlockData data = block.getBlockData(); + if (data instanceof org.bukkit.block.data.Lightable) { + return ((org.bukkit.block.data.Lightable) data).isLit(); + } + } + return false; + } + public static boolean areStairsInverted(Block block) { if (!P.use1_13) { @SuppressWarnings("deprecation") diff --git a/src/com/dre/brewery/listeners/PlayerListener.java b/src/com/dre/brewery/listeners/PlayerListener.java index 3bdfb86..63ecbbd 100644 --- a/src/com/dre/brewery/listeners/PlayerListener.java +++ b/src/com/dre/brewery/listeners/PlayerListener.java @@ -80,7 +80,7 @@ public class PlayerListener implements Listener { // Check if fire alive below cauldron when adding ingredients Block down = clickedBlock.getRelative(BlockFace.DOWN); - if (LegacyUtil.isFireForCauldron(down.getType())) { + if (LegacyUtil.isFireForCauldron(down)) { event.setCancelled(true); boolean handSwap = false;