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


Java PortalCreateEvent.setCancelled方法代码示例

本文整理汇总了Java中org.bukkit.event.world.PortalCreateEvent.setCancelled方法的典型用法代码示例。如果您正苦于以下问题:Java PortalCreateEvent.setCancelled方法的具体用法?Java PortalCreateEvent.setCancelled怎么用?Java PortalCreateEvent.setCancelled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.event.world.PortalCreateEvent的用法示例。


在下文中一共展示了PortalCreateEvent.setCancelled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreatePortal

import org.bukkit.event.world.PortalCreateEvent; //导入方法依赖的package包/类
@EventHandler
public void onCreatePortal(PortalCreateEvent e) {
	Block block = e.getBlocks().get(0);
	Player p = ExtractPlayerFromLocation(block.getLocation());
	if(p instanceof Player) {
		if(!p.hasPermission(PermissionKey.IS_ADMIN.getPermission())) {
			e.setCancelled(true);
			sendMessage(p, ChatColor.RED + "portal creation has been disabled on the server!");
		}
	}
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:12,代码来源:DisablePortalCreationEvent.java

示例2: onPortalCreateEvent

import org.bukkit.event.world.PortalCreateEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPortalCreateEvent(PortalCreateEvent event)
{
	for(Block block : event.getBlocks())
	{
		//Unable to get the player who created it....
		
		ApplicableRegionSet regions = WorldGuardExtraFlagsPlugin.getWorldGuardPlugin().getRegionContainer().createQuery().getApplicableRegions(block.getLocation());
		if (regions.queryValue(null, FlagUtils.NETHER_PORTALS) == State.DENY)
		{
			event.setCancelled(true);
			break;
		}
	}
}
 
开发者ID:isokissa3,项目名称:WorldGuardExtraFlagsPlugin,代码行数:16,代码来源:EntityListener.java

示例3: onPortalCreation

import org.bukkit.event.world.PortalCreateEvent; //导入方法依赖的package包/类
@HookHandler(priority = Priority.CRITICAL, ignoreCanceled = true)
public void onPortalCreation(final PortalCreateHook hook) {
    PortalCreateEvent event = new PortalCreateEvent(null, new CanaryWorld(hook.getWorld()), null);
    event.setCancelled(hook.isCanceled());
    server.getPluginManager().callEvent(event);
    if (event.isCancelled()) {
        hook.setCanceled();
    }
}
 
开发者ID:CanaryBukkitTeam,项目名称:CanaryBukkit,代码行数:10,代码来源:CanaryWorldListener.java

示例4: onPortalCreate

import org.bukkit.event.world.PortalCreateEvent; //导入方法依赖的package包/类
@EventHandler
public void onPortalCreate(PortalCreateEvent e){   
	List<Block> blocks = e.getBlocks();
	for (Block b:blocks){
		Region r = RedProtect.get().rm.getTopRegion(b.getLocation());
		if (r != null && !r.canCreatePortal()){
			e.setCancelled(true);
			break;
		}
	}    	
}
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:12,代码来源:RPPlayerListener.java

示例5: onPortalCreate

import org.bukkit.event.world.PortalCreateEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onPortalCreate(PortalCreateEvent event) {
    event.setCancelled(true);
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:5,代码来源:GeneralListeners.java

示例6: onPortalCreate

import org.bukkit.event.world.PortalCreateEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST) 
public void onPortalCreate(PortalCreateEvent event) {
	event.setCancelled(true);
}
 
开发者ID:netizen539,项目名称:civcraft,代码行数:5,代码来源:PlayerListener.java

示例7: PortalSizeCheck

import org.bukkit.event.world.PortalCreateEvent; //导入方法依赖的package包/类
@EventHandler
public void PortalSizeCheck(PortalCreateEvent e) {
	if(e.getBlocks().size() > 6) {
		e.setCancelled(true);
	}
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:7,代码来源:PortalSizeEvent.java


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