use of com.denizenscript.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelperImpl method getBoundingBox.
@Override
public BoundingBox getBoundingBox(Entity entity) {
AABB boundingBox = ((CraftEntity) entity).getHandle().getBoundingBox();
Vector position = new Vector(boundingBox.minX, boundingBox.minY, boundingBox.minZ);
Vector size = new Vector(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ);
return new BoundingBox(position, size);
}
use of com.denizenscript.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelperImpl method getBoundingBox.
@Override
public BoundingBox getBoundingBox(Entity entity) {
AABB boundingBox = ((CraftEntity) entity).getHandle().getBoundingBox();
Vector position = new Vector(boundingBox.minX, boundingBox.minY, boundingBox.minZ);
Vector size = new Vector(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ);
return new BoundingBox(position, size);
}
use of com.denizenscript.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityBoundingBox method getBoundingBox.
private ListTag getBoundingBox() {
BoundingBox boundingBox = NMSHandler.getEntityHelper().getBoundingBox(entity.getBukkitEntity());
ListTag list = new ListTag();
list.addObject(new LocationTag(boundingBox.getLow().toLocation(entity.getWorld())));
list.addObject(new LocationTag(boundingBox.getHigh().toLocation(entity.getWorld())));
return list;
}
use of com.denizenscript.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityBoundingBox method adjust.
@Override
public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("bounding_box") && mechanism.requireObject(ListTag.class)) {
if (entity.isCitizensNPC()) {
// TODO: Allow editing NPC boxes properly?
return;
}
List<LocationTag> locations = mechanism.valueAsType(ListTag.class).filter(LocationTag.class, mechanism.context);
if (locations.size() == 2) {
BoundingBox boundingBox = new BoundingBox(locations.get(0).toVector(), locations.get(1).toVector());
NMSHandler.getEntityHelper().setBoundingBox(entity.getBukkitEntity(), boundingBox);
modifiedBoxes.add(entity.getUUID());
} else {
mechanism.echoError("Must specify exactly 2 LocationTags in the format '<low>|<high>'!");
}
}
}
use of com.denizenscript.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelperImpl method getBoundingBox.
@Override
public BoundingBox getBoundingBox(Entity entity) {
AxisAlignedBB boundingBox = ((CraftEntity) entity).getHandle().getBoundingBox();
Vector position = new Vector(boundingBox.minX, boundingBox.minY, boundingBox.minZ);
Vector size = new Vector(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ);
return new BoundingBox(position, size);
}
Aggregations