Skip to content

Commit

Permalink
Adjust meta, add meta, formatting...
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 21, 2013
1 parent 2bb7391 commit 2f2063b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 7 deletions.
Expand Up @@ -24,4 +24,4 @@ public boolean fulfilled() {
return fulfilled;
}

}
}
45 changes: 45 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dChunk.java
Expand Up @@ -281,26 +281,71 @@ public String getAttribute(Attribute attribute) {
@Override
public void adjust(Mechanism mechanism, Element value) {

// <--[mechanism]
// @object dChunk
// @name unload
// @input None
// @description
// Removes a chunk from memory.
// @tags
// <chunk.is_loaded>
// -->
if (mechanism.matches("unload")) {
unload(true);
return;
}

// <--[mechanism]
// @object dChunk
// @name unload_safely
// @input None
// @description
// Removes a chunk from memory in a safe manner.
// @tags
// <chunk.is_loaded>
// -->
if (mechanism.matches("unload_safely")) {
unload(true, true);
return;
}

// <--[mechanism]
// @object dChunk
// @name unload_without_saving
// @input None
// @description
// Removes a chunk from memory without saving any recent changes.
// @tags
// <chunk.is_loaded>
// -->
if (mechanism.matches("unload_without_saving")) {
unload(false);
return;
}

// <--[mechanism]
// @object dChunk
// @name unload
// @input None
// @description
// Loads a chunk into memory.
// @tags
// <chunk.is_loaded>
// -->
if (mechanism.matches("load")) {
load(true);
return;
}

// <--[mechanism]
// @object dChunk
// @name regenerate
// @input None
// @description
// Causes the chunk to be entirely deleted and reformed from the world's seed.
// @tags
// None
// -->
if (mechanism.matches("regenerate")) {
getWorld().regenerateChunk(getX(), getZ());
return;
Expand Down
Expand Up @@ -70,7 +70,7 @@ public void setAge(int val) {

} else {
if (ageable.getBukkitEntity().getType() == EntityType.ZOMBIE)
((Zombie) ageable.getBukkitEntity()).setBaby(val < 1 ? false : true);
((Zombie) ageable.getBukkitEntity()).setBaby(val >= 1);
else
((Ageable) ageable.getBukkitEntity()).setAge(val);
}
Expand Down
Expand Up @@ -76,20 +76,20 @@ public String getAttribute(Attribute attribute) {
if (attribute == null) return "null";

// <--[tag]
// @attribute <i@item.framed_item>
// @attribute <e@entity.framed_item>
// @returns dItem
// @description
// returns the material currently framed if the entity is an item frame.
// If the entity is an item frame, returns the material currently framed.
// -->
if (attribute.startsWith("framed_item"))
return getItem()
.getAttribute(attribute.fulfill(1));

// <--[tag]
// @attribute <i@item.has_framed_item>
// @attribute <e@entity.has_framed_item>
// @returns Element(Boolean)
// @description
// returns true if the entity is an item frame that has an item.
// If the entity is an item frame, returns whether the frame has an item in it.
// -->
if (attribute.startsWith("has_framed_item"))
return new Element(hasItem())
Expand All @@ -99,7 +99,7 @@ public String getAttribute(Attribute attribute) {
// @attribute <e@entity.framed_item_rotation>
// @returns Element
// @description
// returns the rotation of the material currently framed if the entity is an item frame.
// If the entity is an item frame, returns the rotation of the material currently framed.
// -->
if (attribute.startsWith("framed_item_rotation"))
return new Element(getItemFrameEntity().getRotation().name().toLowerCase())
Expand Down

0 comments on commit 2f2063b

Please sign in to comment.