Skip to content

Commit

Permalink
fallingblock mecs
Browse files Browse the repository at this point in the history
  • Loading branch information
mergu committed Dec 27, 2017
1 parent c1a602e commit aaaf22b
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion plugin/src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -1916,7 +1916,7 @@ else if (mtr.angle == BlockFace.EAST) {
// @description
// Returns the material of a fallingblock-type entity.
// -->
if (attribute.startsWith("fallingblock_material")) {
if (attribute.startsWith("fallingblock_material") && entity instanceof FallingBlock) {
return dMaterial.getMaterialFrom(((FallingBlock) entity).getMaterial())
.getAttribute(attribute.fulfill(1));
}
Expand Down Expand Up @@ -2648,6 +2648,30 @@ public void adjust(Mechanism mechanism) {
entity.setFallDistance(value.asFloat());
}

// <--[mechanism]
// @object dEntity
// @name fallingblock_drop_item
// @input Element(Boolean)
// @description
// Sets whether the falling block will drop an item if broken
// -->
if (mechanism.matches("fallingblock_drop_item") && mechanism.requireBoolean()
&& entity instanceof FallingBlock) {
((FallingBlock) entity).setDropItem(value.asBoolean());
}

// <--[mechanism]
// @object dEntity
// @name fallingblock_hurt_enemies
// @input Element(Boolean)
// @description
// Sets whether the falling block will hurt enemies when it lands
// -->
if (mechanism.matches("fallingblock_hurt_enemies") && mechanism.requireBoolean()
&& entity instanceof FallingBlock) {
((FallingBlock) entity).setHurtEntities(value.asBoolean());
}

// <--[mechanism]
// @object dEntity
// @name fire_time
Expand Down

0 comments on commit aaaf22b

Please sign in to comment.