当前位置: 首页>>代码示例>>Java>>正文


Java BlockGrowEvent.isCancelled方法代码示例

本文整理汇总了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
}
 
开发者ID:CanaryBukkitTeam,项目名称:CanaryBukkit,代码行数:11,代码来源:CanaryBlockListener.java

示例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);
	}		
}
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:12,代码来源:RPBlockListener.java

示例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);
	}
}
 
开发者ID:NoChanceSD,项目名称:AncientGates,代码行数:14,代码来源:PluginBlockListener.java

示例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());
	}
}
 
开发者ID:maker56,项目名称:UltimateSurvivalGames,代码行数:7,代码来源:ResetListener.java


注:本文中的org.bukkit.event.block.BlockGrowEvent.isCancelled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。