Java 类org.bukkit.event.block.BlockEvent 实例源码

项目:Factoid    文件:PvpListener.java   
/**
 * 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());
        }
    }
}
项目:Factoid    文件:PlayerListener.java   
/**
 * 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;
}
项目:NucleusFramework    文件:BukkitEventForwarder.java   
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);
            }
        }
项目:quick-game-framework    文件:ArenaBase.java   
@EventHandler(priority = EventPriority.MONITOR)
public void onBlockEvent(BlockEvent evt) {
    checkLocation(evt.getBlock().getLocation(), evt);
}
项目:PV-Star    文件:ArenaEventForwarder.java   
@Override
protected void onBlockEvent(BlockEvent event) {
    callEvent(event.getBlock(), event);
}
项目:EnchantmentAPI    文件:CustomEnchantment.java   
/**
 * 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) { }
项目:NucleusFramework    文件:BukkitEventForwarder.java   
/**
 * Invoked whenever a registered block event is called.
 *
 * <p>Intended for optional override.</p>
 *
 * @param event  The called event.
 */
protected void onBlockEvent(BlockEvent event) {}