// <--[tag]
// @attribute <l@location.above>
// @returns dLocation
// @description
// Returns the location one block above this location.
// -->
handlers.put("above", (obj, atr) -> {
dLocation loc = ((dLocation) obj);
return new dLocation(loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())
.getAttribute(attribute.fulfill(1));
});
// <--[tag]
// @attribute <l@location.below>
// @returns dLocation
// @description
// Returns the location one block below this location.
// -->
handlers.put("below", (obj, atr) -> {
dLocation loc = ((dLocation) obj);
return new dLocation(loc.getWorld(), loc.getBlockX() + 0.5, loc.getBlockY() + 0.5, loc.getBlockZ() + 0.5)
.getAttribute(attribute.fulfill(1));
});
// <--[tag]
// @attribute <l@location.block>
// @returns dLocation
// @description
// Returns the location of the block this location is on,
// i.e. returns a location without decimals or direction.
// -->
handlers.put("block", (obj, atr) -> {
dLocation loc = ((dLocation) obj);
return new dLocation(loc.getWorld().getHighestBlockAt(loc).getLocation().add(0, -1, 0))
.getAttribute(attribute.fulfill(1));
});