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

@ -89,7 +89,7 @@ public class FastModeExtent extends AbstractDelegateExtent {
@Override
public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws WorldEditException {
if (enabled) {
dirtyChunks.add(new BlockVector2(location.getBlockX() >> 4, location.getBlockZ() >> 4));
dirtyChunks.add(BlockVector2.at(location.getBlockX() >> 4, location.getBlockZ() >> 4));
return world.setBlock(location, block, false);
} else {
return world.setBlock(location, block, true);

View File

@ -93,7 +93,7 @@ public class SurvivalModeExtent extends AbstractDelegateExtent {
@Override
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
if (toolUse && block.getBlockType().getMaterial().isAir()) {
world.simulateBlockMine(new BlockVector3(x, y, z));
world.simulateBlockMine(BlockVector3.at(x, y, z));
return true;
} else {
return super.setBlock(x, y, z, block);