Package net.aufdemrand.denizen.objects

Examples of net.aufdemrand.denizen.objects.Element


        // @group properties
        // @description
        // If the entity is an arrow, returns the knockback strength of the arrow.
        // -->
        if (attribute.startsWith("knockback"))
            return new Element(((Arrow)arrow.getBukkitEntity()).getKnockbackStrength())
                    .getAttribute(attribute.fulfill(1));

        return null;
    }
View Full Code Here


        // @group properties
        // @description
        // If the entity is an arrow, returns whether the arrow is critical.
        // -->
        if (attribute.startsWith("critical"))
            return new Element(((Arrow)critical.getBukkitEntity()).isCritical())
                    .getAttribute(attribute.fulfill(1));

        return null;
    }
View Full Code Here

        // @mechanism dItem.apple_enchanted
        // @description
        // Returns whether a golden apple item is enchanted.
        // -->
        if (attribute.startsWith("apple_enchanted")) {
            return new Element(item.getItemStack().getDurability() == 1)
                    .getAttribute(attribute.fulfill(1));
        }

        return null;
    }
View Full Code Here

        // @description
        // If the entity is a skeleton, returns what type of skeleton it is.
        // Can return NORMAL or WITHER.
        // -->
        if (attribute.startsWith("skeleton_type"))
            return new Element(((Skeleton)skeleton.getBukkitEntity())
                    .getSkeletonType().name()).getAttribute(attribute.fulfill(1));

        return null;
    }
View Full Code Here

        // Cocoa Plants: SMALL, MEDIUM, LARGE
        // Pumpkin stem, melon stem, carrot, potato: 0-7
        // -->
        if (attribute.startsWith("plant_growth")) {
            if (item.getItemStack().getData() instanceof Crops)
                return new Element(((Crops)item.getItemStack().getData()).getState().name())
                        .getAttribute(attribute.fulfill(1));
            else if (item.getItemStack().getData() instanceof NetherWarts)
                return new Element(((NetherWarts)item.getItemStack().getData()).getState().name())
                        .getAttribute(attribute.fulfill(1));
            else if (item.getItemStack().getData() instanceof CocoaPlant)
                return new Element(((CocoaPlant)item.getItemStack().getData()).getSize().name())
                        .getAttribute(attribute.fulfill(1));
            else
                return new Element(item.getItemStack().getData().getData())
                        .getAttribute(attribute.fulfill(1));
        }

        return null;
    }
View Full Code Here

        // <i@item.is_crop>
        // <i@item.plant_growth>
        // -->

        if (mechanism.matches("plant_growth")) {
            Element inputValue = new Element(mechanism.getValue().asString().toUpperCase());
            if (item.getItemStack().getData() instanceof Crops && inputValue.matchesEnum(CropState.values()))
                ((Crops)item.getItemStack().getData()).setState(CropState.valueOf(mechanism.getValue().asString().toUpperCase()));
            else if (item.getItemStack().getData() instanceof NetherWarts && inputValue.matchesEnum(NetherWartsState.values()))
                ((NetherWarts)item.getItemStack().getData()).setState(NetherWartsState.valueOf(mechanism.getValue().asString().toUpperCase()));
            else if (item.getItemStack().getData() instanceof CocoaPlant && inputValue.matchesEnum(CocoaPlant.CocoaPlantSize.values()))
                ((CocoaPlant)item.getItemStack().getData()).setSize(CocoaPlant.CocoaPlantSize.valueOf(mechanism.getValue().asString().toUpperCase()));
            else if (mechanism.requireInteger())
                item.getItemStack().getData().setData((byte) mechanism.getValue().asInt());
        }
    }
View Full Code Here

        // @group properties
        // @description
        // If the entity is a wolf, returns whether the wolf is angry.
        // -->
        if (attribute.startsWith("angry"))
            return new Element(((Wolf)entity.getBukkitEntity()).isAngry())
                    .getAttribute(attribute.fulfill(1));

        return null;
    }
View Full Code Here

        // @group properties
        // @description
        // Returns the current durability (number of uses) on the item.
        // -->
        if (attribute.startsWith("durability"))
            return new Element(item.getItemStack().getDurability())
                    .getAttribute(attribute.fulfill(1));

        // <--[tag]
        // @attribute <i@item.max_durability>
        // @returns Element(Number)
        // @group properties
        // @description
        // Returns the maximum durability (number of uses) of this item.
        // For use with <@link tag i@item.durability> and <@link mechanism dItem.durability>.
        // -->
        if (attribute.startsWith("max_durability"))
            return new Element(item.getMaterial().getMaterial().getMaxDurability())
                    .getAttribute(attribute.fulfill(1));

        return null;
    }
View Full Code Here

        // @description
        // Returns the spawn egg number of the item.
        // Also works for mob spawners.
        // -->
        if (attribute.startsWith("spawn_egg_entity")) {
            return new Element(item.getItemStack().getDurability())
                    .getAttribute(attribute.fulfill(1));
        }

        return null;
    }
View Full Code Here

        // @group properties
        // @description
        // If the entity is a creeper, returns whether the creeper is powered.
        // -->
        if (attribute.startsWith("powered"))
            return new Element(getPowered())
                    .getAttribute(attribute.fulfill(1));

        return null;
    }
View Full Code Here

TOP

Related Classes of net.aufdemrand.denizen.objects.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.