当前位置: 首页>>代码示例>>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;未经允许,请勿转载。