Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/aufdemrand/Denizen
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcernat committed Sep 28, 2013
2 parents d7bbef4 + ee7bc96 commit f7df079
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/main/java/net/aufdemrand/denizen/objects/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,16 @@ else if (element.toLowerCase().contains(contains.toLowerCase()))

String replace = attribute.getContext(1);
String replacement = "";
if (attribute.startsWith("with", 2)) {
if (attribute.hasContext(2)) replacement = attribute.getContext(2);
attribute.fulfill(1);
attribute.fulfill(1);
if (attribute.startsWith("with")) {
if (attribute.hasContext(1)) {
replacement = attribute.getContext(1);
attribute.fulfill(1);
}
}

return new Element(element.replace(replace, replacement))
.getAttribute(attribute.fulfill(1));
.getAttribute(attribute);
}

// <--[tag]
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ public boolean isGeneric() {

public dLocation getLocation() {

if (!isGeneric()) {
if (isUnique() && entity != null) {
return new dLocation(entity.getLocation());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void setFormat(String format) {
}

public String getFormattedText(ScriptEntry entry) {
String text = getFormat().replaceAll("<text>", entry.getElement("text").asString());
String text = getFormat().replace("<text>", entry.getElement("text").asString());
return TagManager.tag(entry.getPlayer(), entry.getNPC(), text);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2322,6 +2322,9 @@ public void projectileHit(ProjectileHitEvent event) {

dEntity projectile = new dEntity(event.getEntity());

if (projectile.getLocation() == null)
return; // No, I can't explain how or why this would ever happen... nonetheless, it appears it does happen sometimes.

Block block = null;
BlockIterator bi = new BlockIterator(projectile.getLocation().getWorld(), projectile.getLocation().toVector(), projectile.getLocation().getDirection().normalize(), 0, 4);
while(bi.hasNext()) {
Expand Down

0 comments on commit f7df079

Please sign in to comment.