本文整理汇总了Java中org.bukkit.event.entity.EntityCreatePortalEvent类的典型用法代码示例。如果您正苦于以下问题:Java EntityCreatePortalEvent类的具体用法?Java EntityCreatePortalEvent怎么用?Java EntityCreatePortalEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityCreatePortalEvent类属于org.bukkit.event.entity包,在下文中一共展示了EntityCreatePortalEvent类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDragonCreatesPortal
import org.bukkit.event.entity.EntityCreatePortalEvent; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void onDragonCreatesPortal(EntityCreatePortalEvent event)
{
if (event.isCancelled())
return;
Entity entity = event.getEntity();
if (!(entity instanceof EnderDragon))
return;
log("The dragon has been killed!");
Location enderEggLoc = entity.getLocation();
if (enderEggLoc != null) {
End.getBlockAt(enderEggLoc).setTypeId(122);
} else {
log("Failed to process portal, cancelling event anyway!");
}
event.setCancelled(true);
}
示例2: onPortal
import org.bukkit.event.entity.EntityCreatePortalEvent; //导入依赖的package包/类
@EventHandler
public void onPortal(EntityCreatePortalEvent e) {
if (e.getPortalType() == PortalType.ENDER && e.getEntity().getType() == EntityType.ENDER_DRAGON)
if (QuestManagerPlugin.questManagerPlugin.getPluginConfiguration().getWorlds().contains(
e.getEntity().getWorld().getName())) {
e.setCancelled(true);
return;
}
}
示例3: onEntityPortalCreate
import org.bukkit.event.entity.EntityCreatePortalEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOW)
public void onEntityPortalCreate(EntityCreatePortalEvent event) {
event.setCancelled(true);
}
示例4: onEntityCreatesPortal
import org.bukkit.event.entity.EntityCreatePortalEvent; //导入依赖的package包/类
@EventHandler
public void onEntityCreatesPortal(EntityCreatePortalEvent event)
{
if (endDragonRespawn != null)
endDragonRespawn.onDragonCreatesPortal(event);
}