@EventHandler public void onEntityBreakDoor(EntityBreakDoorEvent event) { BlockProtection blockProtection = this.module.getProtectManager().getBlockProtection(event.getBlock().getLocation()); if(blockProtection.exists()) { event.setCancelled(true); } }
@EventHandler(priority = EventPriority.HIGH) public void onEntityBreakDoor(EntityBreakDoorEvent event) { bcoord.setFromLocation(event.getBlock().getLocation()); StructureBlock sb = CivGlobal.getStructureBlock(bcoord); if (sb != null) { event.setCancelled(true); } CampBlock cb = CivGlobal.getCampBlock(bcoord); if (cb != null) { event.setCancelled(true); } }
@EventHandler(ignoreCancelled = true) public void onEntityChangeBlock(EntityChangeBlockEvent event) { AttackType attackType = AttackType.UNKNOWN; if (event instanceof EntityBreakDoorEvent) { attackType = AttackType.ZOMBIE; } else if (event.getEntity() instanceof Enderman) { attackType = AttackType.ENDERMAN; } if (plugin.getChestSettings().allowDestroyBy(attackType)) { return; } if (isProtected(event.getBlock())) { event.setCancelled(true); } }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onEntityBreakDoor(final EntityBreakDoorEvent event) { ActionEntityBlock action = this.newAction(EntityBreak.class, event.getBlock().getWorld()); if (action != null) { action.setNewBlock(event.getTo()); this.setAndLog(action, adjustBlockForDoubleBlocks(event.getBlock().getState()), event.getEntity()); } }
@EventHandler public void onDoorBreak(EntityBreakDoorEvent event) { Location l = event.getBlock().getLocation(); Entity e = event.getEntity(); Map<Location, Integer> b = plugin.getBlessedBlocks(); if (b.containsKey(l)) { if (e instanceof Zombie) { event.setCancelled(true); } } }
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) public void onZombieBreakDoor(EntityBreakDoorEvent event) { if(!GriefPrevention.instance.config_zombiesBreakDoors) event.setCancelled(true); }
@EventHandler public void onBreakDoor(EntityBreakDoorEvent e) { RedProtect.get().logger.debug("RPEntityListener - Is EntityBreakDoorEvent"); }