Skip to content

Commit

Permalink
Add glowing tag+mech
Browse files Browse the repository at this point in the history
Maybe this should be a property? If potion effects properties don't
cover it properly...
  • Loading branch information
mcmonkey4eva committed Apr 1, 2016
1 parent 58e1931 commit 476bccc
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -2310,6 +2310,19 @@ && getBukkitEntity() instanceof Item) {
.getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <e@entity.glowing>
// @returns Element(Boolean)
// @mechanism dEntity.glowing
// @group attributes
// @description
// Returns whether this entity is glowing.
// -->
if (attribute.startsWith("glowing")) {
return new Element(getLivingEntity().isGlowing())
.getAttribute(attribute.fulfill(1));
}

/////////////////////
// TYPE ATTRIBUTES
/////////////////
Expand Down Expand Up @@ -2722,6 +2735,19 @@ public void adjust(Mechanism mechanism) {
getLivingEntity().setGliding(value.asBoolean());
}

// <--[mechanism]
// @object dEntity
// @name glowing
// @input Element(Boolean)
// @description
// Sets whether this entity is glowing.
// @tags
// <e@entity.glowing>
// -->
if (mechanism.matches("glowing") && mechanism.requireBoolean()) {
getLivingEntity().setGlowing(value.asBoolean());
}

// Iterate through this object's properties' mechanisms
for (Property property : PropertyParser.getProperties(this)) {
property.adjust(mechanism);
Expand Down

0 comments on commit 476bccc

Please sign in to comment.