Move vectors to static creators, for caching

This commit is contained in:
Kenzie Togami
2018-10-19 13:13:32 -07:00
parent 399e0ad5fa
commit 2c8b2fe089
69 changed files with 366 additions and 334 deletions

View File

@ -130,7 +130,7 @@ public class EllipsoidRegion extends AbstractRegion {
public void contract(BlockVector3... changes) throws RegionOperationException {
center = center.subtract(calculateDiff(changes));
Vector3 newRadius = radius.subtract(calculateChanges(changes));
radius = new Vector3(1.5, 1.5, 1.5).getMaximum(newRadius);
radius = Vector3.at(1.5, 1.5, 1.5).getMaximum(newRadius);
}
@Override
@ -185,11 +185,11 @@ public class EllipsoidRegion extends AbstractRegion {
for (int x = min.getBlockX(); x <= max.getBlockX(); ++x) {
for (int z = min.getBlockZ(); z <= max.getBlockZ(); ++z) {
if (!contains(new BlockVector3(x, centerY, z))) {
if (!contains(BlockVector3.at(x, centerY, z))) {
continue;
}
chunks.add(new BlockVector2(
chunks.add(BlockVector2.at(
x >> ChunkStore.CHUNK_SHIFTS,
z >> ChunkStore.CHUNK_SHIFTS
));