Skip to content

Commit

Permalink
location.is_within_border tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mergu committed Aug 12, 2017
1 parent f05ba34 commit 9baef1a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugin/src/main/java/net/aufdemrand/denizen/objects/dLocation.java
Expand Up @@ -2,6 +2,7 @@

import net.aufdemrand.denizen.Settings;
import net.aufdemrand.denizen.nms.NMSHandler;
import net.aufdemrand.denizen.nms.NMSVersion;
import net.aufdemrand.denizen.nms.interfaces.EntityHelper;
import net.aufdemrand.denizen.nms.util.PlayerProfile;
import net.aufdemrand.denizen.objects.notable.NotableManager;
Expand Down Expand Up @@ -1837,6 +1838,17 @@ else if (this.getWorld() == toLocation.getWorld()) {
}
}

// <--[tag]
// @attribute <l@location.is_within_border>
// @returns Element(Boolean)
// @description
// Returns whether the location is within the world border.
// -->
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_11_R1) && attribute.startsWith("is_within_border")) {
return new Element(getWorld().getWorldBorder().isInside(this))
.getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <l@location.is_within[<cuboid>/<ellipsoid>]>
// @returns Element(Boolean)
Expand Down

0 comments on commit 9baef1a

Please sign in to comment.