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

@ -45,7 +45,7 @@ public class ClipboardPattern extends AbstractPattern {
if (xp < 0) xp += sx;
if (yp < 0) yp += sy;
if (zp < 0) zp += sz;
return clipboard.getBlock(new BlockVector3(min.getX() + xp, min.getY() + yp, min.getZ() + zp));
return clipboard.getBlock(BlockVector3.at(min.getX() + xp, min.getY() + yp, min.getZ() + zp));
//=======
// public BlockStateHolder apply(BlockVector3 position) {
// int xp = Math.abs(position.getBlockX()) % size.getBlockX();

View File

@ -46,7 +46,7 @@ public interface Pattern extends com.sk89q.worldedit.patterns.Pattern{
@Override
default BaseBlock next(int x, int y, int z) {
return new BaseBlock(apply(new BlockVector3(x, y, z)));
return new BaseBlock(apply(BlockVector3.at(x, y, z)));
}
/**

View File

@ -93,10 +93,6 @@ public class RepeatingExtentPattern extends AbstractPattern {
int x = base.getBlockX() % size.getBlockX();
int y = base.getBlockY() % size.getBlockY();
int z = base.getBlockZ() % size.getBlockZ();
//<<<<<<< HEAD
// return extent.getBlock(new Vector(x, y, z));
//=======
return extent.getFullBlock(new BlockVector3(x, y, z));
//>>>>>>> 399e0ad5... Refactor vector system to be cleaner
return extent.getFullBlock(BlockVector3.at(x, y, z));
}
}