Protect against SignChangeEvent
This commit is contained in:
parent
7b7b189573
commit
91d0676bf8
@ -42,6 +42,7 @@ import org.bukkit.event.block.BlockPistonExtendEvent;
|
|||||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.block.BlockSpreadEvent;
|
import org.bukkit.event.block.BlockSpreadEvent;
|
||||||
|
import org.bukkit.event.block.SignChangeEvent;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||||
import org.bukkit.event.entity.EntityBreakDoorEvent;
|
import org.bukkit.event.entity.EntityBreakDoorEvent;
|
||||||
@ -1423,6 +1424,16 @@ public class EngineMain extends Engine
|
|||||||
event.setCancelled(true);
|
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)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void blockBuild(BlockPistonExtendEvent event)
|
public void blockBuild(BlockPistonExtendEvent event)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user