本文整理汇总了Java中org.bukkit.event.block.BlockGrowEvent.isCancelled方法的典型用法代码示例。如果您正苦于以下问题:Java BlockGrowEvent.isCancelled方法的具体用法?Java BlockGrowEvent.isCancelled怎么用?Java BlockGrowEvent.isCancelled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.event.block.BlockGrowEvent
的用法示例。
在下文中一共展示了BlockGrowEvent.isCancelled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockGrowth
import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@HookHandler(priority = Priority.CRITICAL, ignoreCanceled = true)
public void onBlockGrowth(final BlockGrowHook hook) {
BlockGrowEvent event = new BlockGrowEvent(new CanaryBlock(hook.getOriginal()), null);
event.setCancelled(hook.isCanceled());
server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
hook.setCanceled();
}
// TODO: Fill in second argument
}
示例2: onBlockGrow
import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@EventHandler
public void onBlockGrow(BlockGrowEvent event) {
RedProtect.get().logger.debug("RPBlockListener - Is BlockGrowEvent event: "+event.getNewState().getType().name());
if (event.isCancelled()){
return;
}
Region r = RedProtect.get().rm.getTopRegion(event.getBlock().getLocation());
if (r != null && !r.canGrow()){
event.setCancelled(true);
}
}
示例3: onBlockGrow
import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.NORMAL)
public void onBlockGrow(final BlockGrowEvent event) {
if (event.isCancelled())
return;
final Block block = event.getNewState().getBlock();
final WorldCoord coord = new WorldCoord(block);
// Stop sugarcane blocks from growing
if (BlockUtil.isStandableGateMaterial(event.getNewState().getType()) && Gates.gateFromPortalSurround(coord) != null) {
event.setCancelled(true);
}
}
示例4: onBlockGrow
import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR)
public void onBlockGrow(BlockGrowEvent event) {
if(!event.isCancelled()) {
logChunk(event.getBlock().getLocation());
}
}