Fixes #1438 (unless other things call this event)

This commit is contained in:
Jesse Boyd 2016-11-30 16:15:20 +11:00
parent a3c1ad3ec8
commit 81418b07a8
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 12 additions and 1 deletions

View File

@ -807,7 +807,17 @@ public class PlayerEvents extends PlotListener implements Listener {
if (!PS.get().hasPlotArea(world)) { if (!PS.get().hasPlotArea(world)) {
return; 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); event.setCancelled(true);
} }
} }

View File

@ -54,6 +54,7 @@ public final class Flags {
public static final BooleanFlag ICE_MELT = new BooleanFlag("ice-melt"); public static final BooleanFlag ICE_MELT = new BooleanFlag("ice-melt");
public static final BooleanFlag FIRE_SPREAD = new BooleanFlag("fire-spread"); public static final BooleanFlag FIRE_SPREAD = new BooleanFlag("fire-spread");
public static final BooleanFlag BLOCK_BURN = new BooleanFlag("block-burn"); 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 BLOCK_IGNITION = new BooleanFlag("block-ignition");
public static final BooleanFlag SOIL_DRY = new BooleanFlag("soil-dry"); public static final BooleanFlag SOIL_DRY = new BooleanFlag("soil-dry");
public static final StringListFlag BLOCKED_CMDS = new StringListFlag("blocked-cmds"); public static final StringListFlag BLOCKED_CMDS = new StringListFlag("blocked-cmds");