Java 类org.bukkit.event.entity.EntityCreatePortalEvent 实例源码

项目:DDCustomPlugin    文件:EndDragonRespawn.java   
@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);
}
项目:QuestManager    文件:QuestManager.java   
@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;
    }
}
项目:civcraft    文件:BlockListener.java   
@EventHandler(priority = EventPriority.LOW)
public void onEntityPortalCreate(EntityCreatePortalEvent event) {
    event.setCancelled(true);
}
项目:DDCustomPlugin    文件:CustomPlugin.java   
@EventHandler
public void onEntityCreatesPortal(EntityCreatePortalEvent event)
{
    if (endDragonRespawn != null)
        endDragonRespawn.onDragonCreatesPortal(event);
}