diff --git a/local-pom.xml b/local-pom.xml index 258fad7..76669cb 100644 --- a/local-pom.xml +++ b/local-pom.xml @@ -5,7 +5,7 @@ us.mytheria BlobLib - 1.698.15 + 1.698.16 pom.xml bloblib diff --git a/pom.xml b/pom.xml index ab78a19..71b9954 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 us.mytheria BlobLib - 1.698.15 + 1.698.16 pom diff --git a/src/main/java/us/mytheria/bloblib/entities/Cuboid.java b/src/main/java/us/mytheria/bloblib/entities/Cuboid.java index 3a4dc40..e0879b0 100644 --- a/src/main/java/us/mytheria/bloblib/entities/Cuboid.java +++ b/src/main/java/us/mytheria/bloblib/entities/Cuboid.java @@ -5,6 +5,7 @@ import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; +import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; @@ -263,4 +264,18 @@ public List drawEdges(double distance) { } return result; } + + /** + * Get the entities in the cuboid. + * + * @return List of entities + */ + public List getEntities() { + double distance = getDistance(); + Location center = getCenter(); + return center.getWorld().getNearbyEntities(center, distance, distance, distance) + .stream() + .filter(entity -> isIn(entity.getLocation())) + .toList(); + } } \ No newline at end of file diff --git a/src/main/java/us/mytheria/bloblib/utilities/Structrador.java b/src/main/java/us/mytheria/bloblib/utilities/Structrador.java index cf18799..673fbb1 100644 --- a/src/main/java/us/mytheria/bloblib/utilities/Structrador.java +++ b/src/main/java/us/mytheria/bloblib/utilities/Structrador.java @@ -43,8 +43,8 @@ public class Structrador { private static final ManoratorFactory MANORATOR_FACTORY = BlobLibAPI.getInstance().getManoBukkit().getManoratorFactory(); - private final Structure structure; - private final JavaPlugin plugin; + protected final Structure structure; + protected final JavaPlugin plugin; /** * Will create a structure from the given location and radius. @@ -334,11 +334,6 @@ public void run() { next.setSilent(true); Entity added = world.addEntity(next); added.teleport(entityLocation); - /* - * Intermediate level of API-NMS - * Known to work in 1.20.1 - * Might break in future versions - */ if (added instanceof Hanging hanging) { BlockFace facing = hanging.getFacing(); hanging.setFacingDirection(