diff --git a/src/main/java/de/diddiz/LogBlock/listeners/BlockPlaceLogging.java b/src/main/java/de/diddiz/LogBlock/listeners/BlockPlaceLogging.java index 23441c5..cc65377 100644 --- a/src/main/java/de/diddiz/LogBlock/listeners/BlockPlaceLogging.java +++ b/src/main/java/de/diddiz/LogBlock/listeners/BlockPlaceLogging.java @@ -26,7 +26,7 @@ public class BlockPlaceLogging extends LoggingListener public void onBlockPlace(BlockPlaceEvent event) { final WorldConfig wcfg = getWorldConfig(event.getBlock().getWorld()); if (wcfg != null && wcfg.isLogging(Logging.BLOCKPLACE)) { - final int type = event.getBlock().getTypeId(); + final Material type = event.getBlock().getType(); final BlockState before = event.getBlockReplacedState(); final BlockState after = event.getBlockPlaced().getState(); final String playerName = event.getPlayer().getName(); @@ -53,11 +53,11 @@ public class BlockPlaceLogging extends LoggingListener if (y != 0) { Location finalLoc = new Location(loc.getWorld(), x, y, z); // Run this check to avoid false positives - if (!BukkitUtils.getFallingEntityKillers().contains(finalLoc.getBlock().getTypeId())) { + if (!BukkitUtils.getFallingEntityKillers().contains(finalLoc.getBlock().getType())) { if (finalLoc.getBlock().getType() == Material.AIR || finalLoc.equals(event.getBlock().getLocation())) { - consumer.queueBlockPlace(playerName, finalLoc, type, event.getBlock().getData()); + consumer.queueBlockPlace(playerName, finalLoc, type.getId(), event.getBlock().getData()); } else { - consumer.queueBlockReplace(playerName, finalLoc, finalLoc.getBlock().getTypeId(), finalLoc.getBlock().getData(), type, event.getBlock().getData()); + consumer.queueBlockReplace(playerName, finalLoc, finalLoc.getBlock().getTypeId(), finalLoc.getBlock().getData(), type.getId(), event.getBlock().getData()); } } } @@ -65,8 +65,7 @@ public class BlockPlaceLogging extends LoggingListener } //Sign logging is handled elsewhere - if (wcfg.isLogging(Logging.SIGNTEXT) && (type == 63 || type == 68)) - return; + if (wcfg.isLogging(Logging.SIGNTEXT) && (type.getId() == 63 || type.getId() == 68)) return; //Delay queuing by one tick to allow data to be updated LogBlock.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(LogBlock.getInstance(), new Runnable() diff --git a/src/main/java/de/diddiz/util/BukkitUtils.java b/src/main/java/de/diddiz/util/BukkitUtils.java index 4d1667e..7ac66b6 100644 --- a/src/main/java/de/diddiz/util/BukkitUtils.java +++ b/src/main/java/de/diddiz/util/BukkitUtils.java @@ -332,7 +332,7 @@ public class BukkitUtils return true; } else if (mat == Material.WATER || mat == Material.STATIONARY_WATER || mat == Material.LAVA || mat == Material.STATIONARY_LAVA) { // Fluids return true; - } else if (getFallingEntityKillers().contains(mat.getId()) || mat == Material.FIRE || mat == Material.VINE || mat == Material.LONG_GRASS || mat == Material.DEAD_BUSH) { // Misc. + } else if (getFallingEntityKillers().contains(mat) || mat == Material.FIRE || mat == Material.VINE || mat == Material.LONG_GRASS || mat == Material.DEAD_BUSH) { // Misc. return true; } return false; diff --git a/src/main/java/de/diddiz/util/LoggingUtil.java b/src/main/java/de/diddiz/util/LoggingUtil.java index b7969f1..22860a8 100644 --- a/src/main/java/de/diddiz/util/LoggingUtil.java +++ b/src/main/java/de/diddiz/util/LoggingUtil.java @@ -32,7 +32,7 @@ public class LoggingUtil { Block checkBlock = origin.getRelative(BlockFace.UP); int up = 0; final int highestBlock = checkBlock.getWorld().getHighestBlockYAt(checkBlock.getLocation()); - while (BukkitUtils.getRelativeTopFallables().contains(checkBlock.getTypeId())) { + while (BukkitUtils.getRelativeTopFallables().contains(checkBlock.getType())) { // Record this block as falling consumer.queueBlockBreak(playerName, checkBlock.getState()); @@ -49,9 +49,9 @@ public class LoggingUtil { if (y != 0) { Location finalLoc = new Location(loc.getWorld(), x, y, z); // Run this check to avoid false positives - if (!BukkitUtils.getFallingEntityKillers().contains(finalLoc.getBlock().getTypeId())) { + if (!BukkitUtils.getFallingEntityKillers().contains(finalLoc.getBlock().getType())) { finalLoc.add(0, up, 0); // Add this here after checking for block breakers - if (finalLoc.getBlock().getType() == Material.AIR || BukkitUtils.getRelativeTopFallables().contains(finalLoc.getBlock().getTypeId())) { + if (finalLoc.getBlock().getType() == Material.AIR || BukkitUtils.getRelativeTopFallables().contains(finalLoc.getBlock().getType())) { consumer.queueBlockPlace(playerName, finalLoc, checkBlock.getTypeId(), checkBlock.getData()); } else { consumer.queueBlockReplace(playerName, finalLoc, finalLoc.getBlock().getTypeId(), finalLoc.getBlock().getData(), checkBlock.getTypeId(), checkBlock.getData()); @@ -70,7 +70,7 @@ public class LoggingUtil { if (wcfg == null) return; Block checkBlock = origin.getRelative(BlockFace.UP); - if (BukkitUtils.getRelativeTopBreakabls().contains(checkBlock.getTypeId())) { + if (BukkitUtils.getRelativeTopBreakabls().contains(checkBlock.getType())) { if (wcfg.isLogging(Logging.SIGNTEXT) && checkBlock.getType() == Material.SIGN_POST) { consumer.queueSignBreak(playerName, (Sign) checkBlock.getState()); } else {