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

@@ -69,7 +69,7 @@ public class AreaPickaxe implements BlockTool {
for (int x = ox - range; x <= ox + range; ++x) {
for (int y = oy - range; y <= oy + range; ++y) {
for (int z = oz - range; z <= oz + range; ++z) {
BlockVector3 pos = new BlockVector3(x, y, z);
BlockVector3 pos = BlockVector3.at(x, y, z);
if (editSession.getBlock(pos).getBlockType() != initialType) {
continue;
}

View File

@@ -46,14 +46,14 @@ public class GravityBrush implements Brush {
double y = startY;
final List<BlockStateHolder> blockTypes = new ArrayList<>();
for (; y > position.getBlockY() - size; --y) {
final BlockVector3 pt = new BlockVector3(x, y, z);
final BlockVector3 pt = BlockVector3.at(x, y, z);
final BlockStateHolder block = editSession.getBlock(pt);
if (!block.getBlockType().getMaterial().isAir()) {
blockTypes.add(block);
editSession.setBlock(pt, BlockTypes.AIR.getDefaultState());
}
}
BlockVector3 pt = new BlockVector3(x, y, z);
BlockVector3 pt = BlockVector3.at(x, y, z);
Collections.reverse(blockTypes);
for (int i = 0; i < blockTypes.size();) {
if (editSession.getBlock(pt).getBlockType().getMaterial().isAir()) {