Move vectors to static creators, for caching

This commit is contained in:
Kenzie Togami
2018-10-19 13:13:32 -07:00
committed by IronApollo
parent a9919d130c
commit 4d6045813c
138 changed files with 670 additions and 531 deletions

View File

@ -249,7 +249,7 @@ public abstract class SpongeWorld extends AbstractWorld {
List<Entity> entities = new ArrayList<>();
for (org.spongepowered.api.entity.Entity entity : getWorld().getEntities()) {
org.spongepowered.api.world.Location<World> loc = entity.getLocation();
if (region.contains(new BlockVector3(loc.getX(), loc.getY(), loc.getZ()))) {
if (region.contains(BlockVector3.at(loc.getX(), loc.getY(), loc.getZ()))) {
entities.add(new SpongeEntity(entity));
}
}

View File

@ -57,7 +57,7 @@ public interface SpongeImplAdapter {
}
default Location adapt(org.spongepowered.api.world.Location<org.spongepowered.api.world.World> loc, Vector3d rot) {
Vector3 position = new Vector3(loc.getX(), loc.getY(), loc.getZ());
Vector3 position = Vector3.at(loc.getX(), loc.getY(), loc.getZ());
return new Location(getWorld(loc.getExtent()), position, (float) rot.getY(), (float) rot.getX());
}