當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityType.ENDER_CRYSTAL屬性代碼示例

本文整理匯總了Java中org.bukkit.entity.EntityType.ENDER_CRYSTAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java EntityType.ENDER_CRYSTAL屬性的具體用法?Java EntityType.ENDER_CRYSTAL怎麽用?Java EntityType.ENDER_CRYSTAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.entity.EntityType的用法示例。


在下文中一共展示了EntityType.ENDER_CRYSTAL屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parse

@Override
public PickupModule parse(MapModuleContext context, Logger logger, Document doc) throws InvalidXMLException {
    KitParser kitParser = context.needModule(KitParser.class);
    FilterParser filterParser = context.needModule(FilterParser.class);
    RegionParser regionParser = context.needModule(RegionParser.class);

    for(Element el : XMLUtils.flattenElements(doc.getRootElement(), "pickups", "pickup")) {
        String name = el.getAttributeValue("name");
        EntityType appearance = XMLUtils.parseEnum(Node.fromAttr(el, "appearance"), EntityType.class, "entity type", EntityType.ENDER_CRYSTAL);
        if(appearance != EntityType.ENDER_CRYSTAL) {
            throw new InvalidXMLException("Only ender crystal appearances are supported right now", el);
        }
        Filter visible = filterParser.property(el, "spawn-filter").optional(StaticFilter.ALLOW);
        Filter pickup = filterParser.property(el, "pickup-filter").optional(StaticFilter.ALLOW);
        Region region = regionParser.property(el, "region").validate(RandomPointsValidation.INSTANCE).required();
        Kit kit = kitParser.property(el, "kit").optional(KitNode.EMPTY);
        Duration refresh = XMLUtils.parseDuration(Node.fromAttr(el, "respawn-time"), Duration.ofSeconds(3));
        Duration cooldown = XMLUtils.parseDuration(Node.fromAttr(el, "pickup-time"), Duration.ofSeconds(3));
        boolean effects = XMLUtils.parseBoolean(Node.fromAttr(el, "effects"), true);
        boolean sounds = XMLUtils.parseBoolean(Node.fromAttr(el, "sounds"), true);
        context.features().define(el, new PickupDefinitionImpl(name, appearance, visible, pickup, region, kit, refresh, cooldown, effects, sounds));
    }

    return null;
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:25,代碼來源:PickupModule.java

示例2: onPlayerInteractEntity

@EventHandler
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
    if (event.getRightClicked().getType() == EntityType.ENDER_CRYSTAL) {
        handleBossSpawn(event.getPlayer(), event.getRightClicked());
        event.setCancelled(true);
    } else if (event.getRightClicked().getType() == EntityType.ARMOR_STAND) {
        handleRewards(event.getPlayer(), event.getRightClicked());
    }
}
 
開發者ID:edasaki,項目名稱:ZentrelaRPG,代碼行數:9,代碼來源:DungeonManager.java

示例3: onPlayerHitDungeonDisplay

@EventHandler
public void onPlayerHitDungeonDisplay(EntityDamageByEntityEvent event) {
    if (event.getEntityType() == EntityType.ENDER_CRYSTAL) {
        if (event.getDamager() instanceof Player)
            handleBossSpawn(event.getDamager(), event.getEntity());
        event.setCancelled(true);
    } else if (event.getEntityType() == EntityType.ARMOR_STAND) {
        if (event.getDamager() instanceof Player)
            handleRewards(event.getDamager(), event.getEntity());
    }
}
 
開發者ID:edasaki,項目名稱:ZentrelaRPG,代碼行數:11,代碼來源:DungeonManager.java

示例4: onPlayerInteractEntity

@EventHandler
public static void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
    if (event.getRightClicked().getType() == EntityType.ENDER_CRYSTAL) {
        handleBuff(event.getPlayer(), event.getRightClicked());
        event.setCancelled(true);
    }
}
 
開發者ID:edasaki,項目名稱:ZentrelaRPG,代碼行數:7,代碼來源:BuffManager.java

示例5: onPlayerHitBuffEvent

@EventHandler
public static void onPlayerHitBuffEvent(EntityDamageByEntityEvent event) {
    if (event.getEntityType() == EntityType.ENDER_CRYSTAL) {
        if (event.getDamager() instanceof Player)
            handleBuff(event.getDamager(), event.getEntity());
        else if (event.getDamager() instanceof Projectile) {
            if (((Projectile) event.getDamager()).getShooter() instanceof Player)
                handleBuff(((Player) ((Projectile) event.getDamager()).getShooter()), event.getEntity());
        }
        event.setCancelled(true);
    }
}
 
開發者ID:edasaki,項目名稱:ZentrelaRPG,代碼行數:12,代碼來源:BuffManager.java

示例6: getType

public EntityType getType() {
    return EntityType.ENDER_CRYSTAL;
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:3,代碼來源:CraftEnderCrystal.java


注:本文中的org.bukkit.entity.EntityType.ENDER_CRYSTAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。