Java Code Examples for org.bukkit.entity.EntityType#ENDER_CRYSTAL

The following examples show how to use org.bukkit.entity.EntityType#ENDER_CRYSTAL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PickupModule.java    From ProjectAres with GNU Affero General Public License v3.0 6 votes vote down vote up
@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;
}
 
Example 2
Source File: CraftEnderCrystal.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public EntityType getType() {
    return EntityType.ENDER_CRYSTAL;
}
 
Example 3
Source File: CraftEnderCrystal.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public EntityType getType() {
    return EntityType.ENDER_CRYSTAL;
}