/** * Check when a player deposits fire and add it to list * * @param event the event * @param player the player */ private void checkForPvpFire(BlockEvent event, Player player) { IPlayerConfEntry entry; if (player != null && (entry = playerConf.get(player)) != null) { Location loc = event.getBlock().getLocation(); IDummyLand land = Factoid.getThisPlugin().iLands().getLandOrOutsideArea(loc); if (land.getFlagAndInherit(FlagList.FULL_PVP.getFlagType()).getValueBoolean() == false || land.getFlagAndInherit(FlagList.FULL_PVP.getFlagType()).getValueBoolean() == false) { // Add fire for pvp listen playerFireLocation.put(loc, entry.getPlayerContainer()); } } }
/** * Check when a player deposits fire * * @param event the event * @param player the player * @return if the event must be cancelled */ private boolean checkForPutFire(BlockEvent event, Player player) { if (player != null && !playerConf.get(player).isAdminMod()) { IDummyLand land = Factoid.getThisPlugin().iLands().getLandOrOutsideArea( event.getBlock().getLocation()); if ((land instanceof ILand && ((ILand) land).isBanned(player)) || (!checkPermission(land, player, PermissionList.FIRE.getPermissionType()))) { messagePermission(player); return true; } } return false; }
public void on(Object e) { if (!(e instanceof Event)) return; Event event = (Event) e; onEvent(event); if (event instanceof PlayerEvent) { onPlayerEvent((PlayerEvent)event); } else if (event instanceof BlockEvent) { onBlockEvent((BlockEvent)event); } else if (event instanceof HangingEvent) { onHangingEvent((HangingEvent)event); } else if (event instanceof InventoryEvent) { onInventoryEvent((InventoryEvent) event); } else if (event instanceof VehicleEvent) { onVehicleEvent((VehicleEvent) event); } else if (event instanceof EntityEvent) { onEntityEvent((EntityEvent) event); } }
@EventHandler(priority = EventPriority.MONITOR) public void onBlockEvent(BlockEvent evt) { checkLocation(evt.getBlock().getLocation(), evt); }
@Override protected void onBlockEvent(BlockEvent event) { callEvent(event.getBlock(), event); }
/** * Applies effects while breaking blocks (for tool effects) * * @param user the player with the enchantment * @param block the block being broken * @param event the event details (either BlockBreakEvent or BlockDamageEvent) */ public void applyBreak(final LivingEntity user, final Block block, final int level, final BlockEvent event) { }
/** * Invoked whenever a registered block event is called. * * <p>Intended for optional override.</p> * * @param event The called event. */ protected void onBlockEvent(BlockEvent event) {}