Skip to content

Commit

Permalink
Gentler dEntity errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Apr 28, 2015
1 parent fca8625 commit fff6b89
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -161,9 +161,13 @@ public static dEntity valueOf(String string, TagContext context) {
else if (entityGroup.matches("P@")) {
LivingEntity returnable = dPlayer.valueOf(m.group(2)).getPlayerEntity();

if (returnable != null) return new dEntity(returnable);
else dB.echoError("Invalid Player! '" + m.group(2)
+ "' could not be found. Has the player logged off?");
if (returnable != null) {
return new dEntity(returnable);
}
else if (context.debug) {
dB.echoError("Invalid Player! '" + m.group(2)
+ "' could not be found. Has the player logged off?");
}
}

// Assume entity
Expand Down Expand Up @@ -219,7 +223,9 @@ else if (entityGroup.matches("P@")) {
}
}

dB.log("valueOf dEntity returning null: " + string);
if (context.debug) {
dB.log("valueOf dEntity returning null: " + string);
}

return null;
}
Expand Down

0 comments on commit fff6b89

Please sign in to comment.