From 91d0676bf84cd45072fda030e5d9c05a83c38f90 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Fri, 17 Jun 2016 13:38:45 +0200 Subject: [PATCH] Protect against SignChangeEvent --- src/com/massivecraft/factions/engine/EngineMain.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/com/massivecraft/factions/engine/EngineMain.java b/src/com/massivecraft/factions/engine/EngineMain.java index 77b343ab..b774fb8b 100644 --- a/src/com/massivecraft/factions/engine/EngineMain.java +++ b/src/com/massivecraft/factions/engine/EngineMain.java @@ -42,6 +42,7 @@ import org.bukkit.event.block.BlockPistonExtendEvent; import org.bukkit.event.block.BlockPistonRetractEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockSpreadEvent; +import org.bukkit.event.block.SignChangeEvent; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.EntityBreakDoorEvent; @@ -1422,6 +1423,16 @@ public class EngineMain extends Engine event.setCancelled(true); } + + @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) + public void blockBuild(SignChangeEvent event) + { + boolean verboose = ! isFake(event); + + if (canPlayerBuildAt(event.getPlayer(), PS.valueOf(event.getBlock()), verboose)) return; + + event.setCancelled(true); + } @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void blockBuild(BlockPistonExtendEvent event)