use of pl.themolka.arcade.event.BlockTransformEvent in project Arcade2 by ShootGame.
the class BlockTransformListeners method post.
private boolean post(Event cause, Block block, BlockState oldState, BlockState newState, Player bukkit, boolean cancel) {
ArcadePlayer player = null;
if (bukkit != null) {
player = this.plugin.getPlayer(bukkit);
}
BlockTransformEvent event = new BlockTransformEvent(this.plugin, block, cause, newState, oldState, player);
this.plugin.getEventBus().publish(event);
boolean canceled = cancel && event.isCanceled() && cause instanceof Cancellable;
if (canceled) {
((Cancellable) cause).setCancelled(true);
}
return event.isCanceled();
}
Aggregations