From f479a705947e787dfe70cd94fc8b4b53e9d5a699 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 17 May 2018 15:11:44 +1000 Subject: [PATCH] Fixes #1729 --- .../bukkit/listeners/PlayerEvents.java | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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 86d7b2484..e3083dd5e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -1017,7 +1017,7 @@ public class PlayerEvents extends PlotListener implements Listener { } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) - public void onBlockSpread(BlockFormEvent event) { + public void onBlockForm(BlockFormEvent event) { Block block = event.getBlock(); Location location = BukkitUtil.getLocation(block.getLocation()); if (location.isPlotRoad()) { @@ -1032,8 +1032,25 @@ public class PlayerEvents extends PlotListener implements Listener { if (plot == null) { return; } - if (Flags.SNOW_FORM.isFalse(plot)) { - event.setCancelled(true); + switch (event.getNewState().getType()) { + case SNOW: + case SNOW_BLOCK: + if (Flags.SNOW_FORM.isFalse(plot)) { + event.setCancelled(true); + } + return; + case ICE: + case FROSTED_ICE: + case PACKED_ICE: + if (Flags.ICE_FORM.isFalse(plot)) { + event.setCancelled(true); + } + return; + case STONE: + case OBSIDIAN: + case COBBLESTONE: + // TODO event ? + return; } }