Skip to content

Commit

Permalink
Add location.formatted.citizens + fix dCuboid
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 22, 2013
1 parent 67e8e66 commit d55ddd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dCuboid.java
Expand Up @@ -97,7 +97,7 @@ public static boolean matches(String string) {
// regex patterns used for matching
final Pattern location_by_saved = Pattern.compile("(cu@)(.+)");
final Pattern location =
Pattern.compile("((-?\\d+,){3})\\w+\\|((-?\\d+,){3})\\w+",
Pattern.compile("((-?\\d+,){3})[\\w\\s]+\\|((-?\\d+,){3})[\\w\\s]+",
Pattern.CASE_INSENSITIVE);

Matcher m;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dLocation.java
Expand Up @@ -776,6 +776,16 @@ public int compare(dEntity ent1, dEntity ent2) {
// IDENTIFICATION ATTRIBUTES
/////////////////

// <--[tag]
// @attribute <l@location.formatted.citizens>
// @returns Element
// @description
// Returns the location formatted for a Citizens command.
// EG: x.x:y.y:z.z:world
// -->
if (attribute.startsWith("formatted.citizens"))
return new Element(getX() + ":" + getY() + ":" + getZ() + ":" + getWorld().getName()).getAttribute(attribute.fulfill(2));

// <--[tag]
// @attribute <l@location.formatted>
// @returns Element
Expand Down

0 comments on commit d55ddd6

Please sign in to comment.