use of net.aufdemrand.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelper_v1_9_R2 method getBoundingBox.
@Override
public BoundingBox getBoundingBox(Entity entity) {
AxisAlignedBB boundingBox = ((CraftEntity) entity).getHandle().getBoundingBox();
Vector position = new Vector(boundingBox.a, boundingBox.b, boundingBox.c);
Vector size = new Vector(boundingBox.d, boundingBox.e, boundingBox.f);
return new BoundingBox(position, size);
}
use of net.aufdemrand.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityBoundingBox method adjust.
@Override
public void adjust(Mechanism mechanism) {
Element value = mechanism.getValue();
if (mechanism.matches("bounding_box")) {
if (entity.isCitizensNPC()) {
// TODO: Allow editing NPC boxes properly?
return;
}
List<dLocation> locations = value.asType(dList.class).filter(dLocation.class);
if (locations.size() == 2) {
BoundingBox boundingBox = new BoundingBox(locations.get(0).toVector(), locations.get(1).toVector());
NMSHandler.getInstance().getEntityHelper().setBoundingBox(entity.getBukkitEntity(), boundingBox);
modifiedBoxes.add(entity.getUUID());
} else {
dB.echoError("Must specify exactly 2 dLocations in the format '<low>|<high>'!");
}
}
}
use of net.aufdemrand.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelper_v1_11_R1 method getBoundingBox.
@Override
public BoundingBox getBoundingBox(Entity entity) {
AxisAlignedBB boundingBox = ((CraftEntity) entity).getHandle().getBoundingBox();
Vector position = new Vector(boundingBox.a, boundingBox.b, boundingBox.c);
Vector size = new Vector(boundingBox.d, boundingBox.e, boundingBox.f);
return new BoundingBox(position, size);
}
use of net.aufdemrand.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelper_v1_8_R3 method getBoundingBox.
@Override
public BoundingBox getBoundingBox(Entity entity) {
AxisAlignedBB boundingBox = ((CraftEntity) entity).getHandle().getBoundingBox();
Vector position = new Vector(boundingBox.a, boundingBox.b, boundingBox.c);
Vector size = new Vector(boundingBox.d, boundingBox.e, boundingBox.f);
return new BoundingBox(position, size);
}
use of net.aufdemrand.denizen.nms.util.BoundingBox in project Denizen-For-Bukkit by DenizenScript.
the class EntityBoundingBox method getBoundingBox.
private dList getBoundingBox() {
BoundingBox boundingBox = NMSHandler.getInstance().getEntityHelper().getBoundingBox(entity.getBukkitEntity());
dList list = new dList();
list.add(new dLocation(boundingBox.getLow()).identify());
list.add(new dLocation(boundingBox.getHigh()).identify());
return list;
}
Aggregations