From 81418b07a88329fe3c52c9e9d6a54d69242e2a2e Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 30 Nov 2016 16:15:20 +1100 Subject: [PATCH] Fixes #1438 (unless other things call this event) --- .../plotsquared/bukkit/listeners/PlayerEvents.java | 12 +++++++++++- .../com/intellectualcrafters/plot/flag/Flags.java | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 646688a3f..8f38cb0ac 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -807,7 +807,17 @@ public class PlayerEvents extends PlotListener implements Listener { if (!PS.get().hasPlotArea(world)) { return; } - if (BukkitUtil.getLocation(event.getBlock().getLocation()).getPlotArea() != null) { + Location location = BukkitUtil.getLocation(event.getBlock().getLocation()); + PlotArea area = location.getPlotArea(); + if (area == null) { + return; + } + Plot plot = area.getOwnedPlot(location); + if (plot == null) { + event.setCancelled(true); + return; + } + if (!Flags.FROST_WALKER.isTrue(plot)) { event.setCancelled(true); } } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java index 7df35cd50..fa167fd0f 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java @@ -54,6 +54,7 @@ public final class Flags { public static final BooleanFlag ICE_MELT = new BooleanFlag("ice-melt"); public static final BooleanFlag FIRE_SPREAD = new BooleanFlag("fire-spread"); public static final BooleanFlag BLOCK_BURN = new BooleanFlag("block-burn"); + public static final BooleanFlag FROST_WALKER = new BooleanFlag("frost-walker"); public static final BooleanFlag BLOCK_IGNITION = new BooleanFlag("block-ignition"); public static final BooleanFlag SOIL_DRY = new BooleanFlag("soil-dry"); public static final StringListFlag BLOCKED_CMDS = new StringListFlag("blocked-cmds");