diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index f08fbccaf..9c2bc49db 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -375,7 +375,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain case FIREBALL: case DRAGON_FIREBALL: case DROPPED_ITEM: - if (Settings.Enabled_Components.KILL_ROAD_ITEMS || plotArea + if (Settings.Enabled_Components.KILL_ROAD_ITEMS && plotArea .getOwnedPlotAbs( BukkitUtil.getLocation(entity.getLocation())) == null) { entity.remove(); @@ -386,7 +386,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain case FALLING_BLOCK: // managed elsewhere continue; - case SHULKER: { + case SHULKER: if (Settings.Enabled_Components.KILL_ROAD_MOBS) { LivingEntity livingEntity = (LivingEntity) entity; List meta = entity.getMetadata("plot"); @@ -436,7 +436,6 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain } } continue; - } case LLAMA: case DONKEY: case MULE: diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index 890d82f85..93d462d32 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -1876,10 +1876,14 @@ import java.util.regex.Pattern; eventType = PlayerBlockEventType.TELEPORT_OBJECT; break; default: - int blockId = ((LegacyPlotBlock) PlotSquared.get().IMP.getLegacyMappings() - .fromStringToLegacy(blockType.name())).id; - if (blockId > 197) { - eventType = PlayerBlockEventType.INTERACT_BLOCK; + LegacyPlotBlock legacyPlotBlock = + (LegacyPlotBlock) PlotSquared.get().IMP.getLegacyMappings() + .fromStringToLegacy(blockType.name()); + if (legacyPlotBlock != null) { + int blockId = legacyPlotBlock.id; + if (blockId > 197) { + eventType = PlayerBlockEventType.INTERACT_BLOCK; + } } break; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java index 013b2c7ca..2995a448d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java @@ -351,7 +351,7 @@ import java.util.concurrent.atomic.AtomicInteger; task.set(statement); task.addBatch(statement); try { - if (statement.isClosed()) { + if (statement != null && statement.isClosed()) { statement = null; } } catch (AbstractMethodError ignore) {