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
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)) {
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);
}
}