Skip to content

Commit

Permalink
locationtag.distance: patch null world compat
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 26, 2022
1 parent d88b80b commit 3c5768b
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -3413,15 +3413,21 @@ else if (attribute.startsWith("vertical", 2)) {
}
}

if (!object.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) {
if (object.getWorldName() == null) {
if (toLocation.getWorldName() != null) {
if (!attribute.hasAlternative()) {
Debug.echoError("Can't measure distance between a non-world and a world!");
}
return null;
}
}
else if (!object.getWorldName().equalsIgnoreCase(toLocation.getWorldName())) {
if (!attribute.hasAlternative()) {
Debug.echoError("Can't measure distance between two different worlds!");
}
return null;
}
else {
return new ElementTag(object.distance(toLocation));
}
return new ElementTag(object.distance(toLocation));
}
return null;
});
Expand Down

0 comments on commit 3c5768b

Please sign in to comment.