mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-01-05 18:37:40 +01:00
Merge branch 'pr/194'
This commit is contained in:
parent
e123f32728
commit
d643982dd3
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user