Merge branch 'pr/194'

This commit is contained in:
Tristan van den Elzen 2019-07-23 01:46:54 +02:00 committed by Sn0wStorm
parent e123f32728
commit d643982dd3
3 changed files with 8 additions and 3 deletions

View File

@ -5,7 +5,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Levelled;
import org.bukkit.entity.Player;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.inventory.ItemStack;
@ -36,7 +35,7 @@ public class BCauldron {
public void onUpdate() {
// Check if fire still alive
if (!Util.isChunkLoaded(block) || block.getRelative(BlockFace.DOWN).getType() == Material.FIRE || LegacyUtil.isLava(block.getRelative(BlockFace.DOWN).getType())) {
if (!Util.isChunkLoaded(block) || LegacyUtil.isFireForCauldron(block.getRelative(BlockFace.DOWN).getType())) {
// add a minute to cooking time
state++;
if (someRemoved) {

View File

@ -104,6 +104,12 @@ public class LegacyUtil {
return type.name().endsWith("SIGN") || (!P.use1_13 && type == SIGN_POST);
}
public static boolean isFireForCauldron(Material type) {
return type == Material.FIRE
|| type == Material.CAMPFIRE
|| LegacyUtil.isLava(type);
}
// LAVA and STATIONARY_LAVA are merged as of 1.13
public static boolean isLava(Material type) {
return type == Material.LAVA || (!P.use1_13 && type == STATIONARY_LAVA) || (MAGMA != null && type == MAGMA);

View File

@ -78,7 +78,7 @@ public class PlayerListener implements Listener {
// Check if fire alive below cauldron when adding ingredients
Block down = clickedBlock.getRelative(BlockFace.DOWN);
if (down.getType() == Material.FIRE || LegacyUtil.isLava(down.getType())) {
if (LegacyUtil.isFireForCauldron(down.getType())) {
event.setCancelled(true);
boolean handSwap = false;