Skip to content

Commit

Permalink
Added <e@entity.is_spawned>
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcernat committed Sep 25, 2013
1 parent 2ef9dc7 commit 47d227e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -1425,6 +1425,17 @@ else if ((float) getLivingEntity().getHealth() / maxHealth < 1)
.getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <e@entity.is_spawned>
// @returns Element(Boolean)
// @description
// Returns true if the entity is spawned. Else, returns false.
// -->
if (attribute.startsWith("is_spawned")) {
return new Element(isSpawned())
.getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <e@entity.is_tamed>
// @returns Element(Boolean)
Expand Down
Expand Up @@ -25,7 +25,7 @@ public class NoteBlockReceiver implements Receiver
{
private static final float VOLUME_RANGE = 10.0f;

private final List<dEntity> listeners;
private List<dEntity> listeners;
private dLocation location;
private final Map<Integer, Integer> channelPatches;

Expand Down Expand Up @@ -113,7 +113,7 @@ else if (listeners != null) {
@Override
public void close()
{
if (listeners != null) listeners.clear();
if (listeners != null) listeners = null;
if (location != null) location = null;
channelPatches.clear();
}
Expand Down

0 comments on commit 47d227e

Please sign in to comment.