Permalink
Browse files

Move vectors to static creators, for caching

  • Loading branch information...
kenzierocks committed Oct 19, 2018
1 parent 399e0ad commit 2c8b2fe0898c420c5cbd55ad5849c7f99cabb08e
Showing with 369 additions and 337 deletions.
  1. +2 −2 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java
  2. +1 −1 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java
  3. +1 −1 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
  4. +3 −3 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java
  5. +1 −1 worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java
  6. +5 −5 worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java
  7. +36 −36 worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java
  8. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java
  9. +10 −10 worldedit-core/src/main/java/com/sk89q/worldedit/PlayerDirection.java
  10. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java
  11. +12 −12 worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java
  12. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java
  13. +2 −2 worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java
  14. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java
  15. +13 −13 worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java
  16. +0 −1 worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java
  17. +0 −1 worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java
  18. +4 −4 worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java
  19. +4 −4 worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java
  20. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicWriter.java
  21. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/ChunkBatchingExtent.java
  22. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java
  23. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java
  24. +0 −1 worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java
  25. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java
  26. +11 −11 worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java
  27. +5 −5 worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java
  28. +5 −5 worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/NonRisingVisitor.java
  29. +3 −3 worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java
  30. +36 −26 worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector2.java
  31. +40 −29 worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector3.java
  32. +34 −27 worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector2.java
  33. +38 −30 worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3.java
  34. +6 −6 worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java
  35. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/math/geom/Polygons.java
  36. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/Node.java
  37. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/AffineTransform.java
  38. +8 −8 worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java
  39. +4 −4 worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java
  40. +2 −2 worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java
  41. +3 −3 worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java
  42. +4 −5 worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java
  43. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/regions/factory/CylinderRegionFactory.java
  44. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/regions/factory/SphereRegionFactory.java
  45. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java
  46. +2 −2 worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java
  47. +2 −2 worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java
  48. +2 −2 worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java
  49. +2 −2 worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java
  50. +3 −3 worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java
  51. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java
  52. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java
  53. +21 −21 worldedit-core/src/main/java/com/sk89q/worldedit/util/Direction.java
  54. +4 −4 worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java
  55. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java
  56. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/util/gson/VectorAdapter.java
  57. +2 −2 worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java
  58. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java
  59. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk13.java
  60. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java
  61. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java
  62. +1 −1 worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java
  63. +7 −7 worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java
  64. +2 −2 worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeAdapter.java
  65. +1 −1 worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java
  66. +1 −1 worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java
  67. +1 −1 worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java
  68. +1 −1 worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java
  69. +1 −1 worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java
@@ -240,7 +240,7 @@ public static Location adapt(org.bukkit.Location location) {
*/
public static Vector3 asVector(org.bukkit.Location location) {
checkNotNull(location);
return new Vector3(location.getX(), location.getY(), location.getZ());
return Vector3.at(location.getX(), location.getY(), location.getZ());
}
/**
@@ -251,7 +251,7 @@ public static Vector3 asVector(org.bukkit.Location location) {
*/
public static BlockVector3 asBlockVector(org.bukkit.Location location) {
checkNotNull(location);
return new BlockVector3(location.getX(), location.getY(), location.getZ());
return BlockVector3.at(location.getX(), location.getY(), location.getZ());
}
/**
@@ -175,7 +175,7 @@ public void floatAt(int x, int y, int z, boolean alwaysGlass) {
return;
}
setPosition(new Vector3(x + 0.5, y, z + 0.5));
setPosition(Vector3.at(x + 0.5, y, z + 0.5));
player.setFlying(true);
}
@@ -169,7 +169,7 @@ public boolean regenerate(Region region, EditSession editSession) {
BlockStateHolder[] history = new BlockStateHolder[16 * 16 * (getMaxY() + 1)];
for (BlockVector2 chunk : region.getChunks()) {
BlockVector3 min = new BlockVector3(chunk.getBlockX() * 16, 0, chunk.getBlockZ() * 16);
BlockVector3 min = BlockVector3.at(chunk.getBlockX() * 16, 0, chunk.getBlockZ() * 16);
// First save all the blocks inside
for (int x = 0; x < 16; ++x) {
@@ -40,7 +40,7 @@ public EditSessionBlockChangeDelegate(EditSession editSession) {
@Override
public boolean setBlockData(int x, int y, int z, BlockData blockData) {
try {
editSession.setBlock(new BlockVector3(x, y, z), BukkitAdapter.adapt(blockData));
editSession.setBlock(BlockVector3.at(x, y, z), BukkitAdapter.adapt(blockData));
} catch (MaxChangedBlocksException e) {
return false;
}
@@ -49,7 +49,7 @@ public boolean setBlockData(int x, int y, int z, BlockData blockData) {
@Override
public BlockData getBlockData(int x, int y, int z) {
return BukkitAdapter.adapt(editSession.getBlock(new BlockVector3(x, y, z)));
return BukkitAdapter.adapt(editSession.getBlock(BlockVector3.at(x, y, z)));
}
@Override
@@ -59,7 +59,7 @@ public int getHeight() {
@Override
public boolean isEmpty(int x, int y, int z) {
return editSession.getBlock(new BlockVector3(x, y, z)).getBlockType().getMaterial().isAir();
return editSession.getBlock(BlockVector3.at(x, y, z)).getBlockType().getMaterial().isAir();
}
}
@@ -169,7 +169,7 @@ public static int getTypeCode(Class<? extends Tag> clazz) {
*/
public static Vector3 toVector(ListTag listTag) {
checkNotNull(listTag);
return new Vector3(listTag.asDouble(0), listTag.asDouble(1), listTag.asDouble(2));
return Vector3.at(listTag.asDouble(0), listTag.asDouble(1), listTag.asDouble(2));
}
/**
@@ -215,7 +215,7 @@ public Vector3 getVector(String path) {
return null;
}
return new Vector3(x, y, z);
return Vector3.at(x, y, z);
}
/**
@@ -239,7 +239,7 @@ public Vector2 getVector2(String path) {
return null;
}
return new Vector2(x, z);
return Vector2.at(x, z);
}
/**
@@ -571,7 +571,7 @@ public boolean getBoolean(String path, boolean def) {
continue;
}
list.add(new Vector3(x, y, z));
list.add(Vector3.at(x, y, z));
}
return list;
@@ -601,7 +601,7 @@ public boolean getBoolean(String path, boolean def) {
continue;
}
list.add(new Vector2(x, z));
list.add(Vector2.at(x, z));
}
return list;
@@ -631,7 +631,7 @@ public boolean getBoolean(String path, boolean def) {
continue;
}
list.add(new BlockVector2(x, z));
list.add(BlockVector2.at(x, z));
}
return list;
@@ -482,7 +482,7 @@ public BaseBlock getFullBlock(BlockVector3 position) {
*/
public int getHighestTerrainBlock(int x, int z, int minY, int maxY) {
for (int y = maxY; y >= minY; --y) {
BlockVector3 pt = new BlockVector3(x, y, z);
BlockVector3 pt = BlockVector3.at(x, y, z);
BlockState block = getBlock(pt);
if (block.getBlockType().getMaterial().isMovementBlocker()) {
return y;
@@ -713,7 +713,7 @@ public int fillXZ(BlockVector3 origin, Pattern pattern, double radius, int depth
checkArgument(depth >= 1, "depth >= 1");
MaskIntersection mask = new MaskIntersection(
new RegionMask(new EllipsoidRegion(null, origin, new Vector3(radius, radius, radius))),
new RegionMask(new EllipsoidRegion(null, origin, Vector3.at(radius, radius, radius))),
new BoundedHeightMask(
Math.max(origin.getBlockY() - depth + 1, 0),
Math.min(getWorld().getMaxY(), origin.getBlockY())),
@@ -904,8 +904,8 @@ public int center(Region region, Pattern pattern) throws MaxChangedBlocksExcepti
Vector3 center = region.getCenter();
Region centerRegion = new CuboidRegion(
getWorld(), // Causes clamping of Y range
new BlockVector3(((int) center.getX()), ((int) center.getY()), ((int) center.getZ())),
new BlockVector3(MathUtils.roundHalfUp(center.getX()),
BlockVector3.at(((int) center.getX()), ((int) center.getY()), ((int) center.getZ())),
BlockVector3.at(MathUtils.roundHalfUp(center.getX()),
center.getY(), MathUtils.roundHalfUp(center.getZ())));
return setBlocks(centerRegion, pattern);
}
@@ -1055,7 +1055,7 @@ public int overlayCuboidBlocks(Region region, Pattern pattern) throws MaxChanged
checkNotNull(pattern);
BlockReplace replace = new BlockReplace(this, pattern);
RegionOffset offset = new RegionOffset(new BlockVector3(0, 1, 0), replace);
RegionOffset offset = new RegionOffset(BlockVector3.at(0, 1, 0), replace);
GroundFunction ground = new GroundFunction(new ExistingBlockMask(this), offset);
LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground);
Operations.completeLegacy(visitor);
@@ -1180,7 +1180,7 @@ public int drainArea(BlockVector3 origin, double radius) throws MaxChangedBlocks
MaskIntersection mask = new MaskIntersection(
new BoundedHeightMask(0, getWorld().getMaxY()),
new RegionMask(new EllipsoidRegion(null, origin, new Vector3(radius, radius, radius))),
new RegionMask(new EllipsoidRegion(null, origin, Vector3.at(radius, radius, radius))),
getWorld().createLiquidMask());
BlockReplace replace = new BlockReplace(this, new BlockPattern(BlockTypes.AIR.getDefaultState()));
@@ -1220,7 +1220,7 @@ public int fixLiquid(BlockVector3 origin, double radius, BlockType fluid) throws
// There are boundaries that the routine needs to stay in
MaskIntersection mask = new MaskIntersection(
new BoundedHeightMask(0, Math.min(origin.getBlockY(), getWorld().getMaxY())),
new RegionMask(new EllipsoidRegion(null, origin, new Vector3(radius, radius, radius))),
new RegionMask(new EllipsoidRegion(null, origin, Vector3.at(radius, radius, radius))),
blockMask
);
@@ -1501,12 +1501,12 @@ public int thaw(BlockVector3 position, double radius)
int ceilRadius = (int) Math.ceil(radius);
for (int x = ox - ceilRadius; x <= ox + ceilRadius; ++x) {
for (int z = oz - ceilRadius; z <= oz + ceilRadius; ++z) {
if ((new BlockVector3(x, oy, z)).distanceSq(position) > radiusSq) {
if ((BlockVector3.at(x, oy, z)).distanceSq(position) > radiusSq) {
continue;
}
for (int y = world.getMaxY(); y >= 1; --y) {
BlockVector3 pt = new BlockVector3(x, y, z);
BlockVector3 pt = BlockVector3.at(x, y, z);
BlockType id = getBlock(pt).getBlockType();
if (id == BlockTypes.ICE) {
@@ -1551,12 +1551,12 @@ public int simulateSnow(BlockVector3 position, double radius) throws MaxChangedB
int ceilRadius = (int) Math.ceil(radius);
for (int x = ox - ceilRadius; x <= ox + ceilRadius; ++x) {
for (int z = oz - ceilRadius; z <= oz + ceilRadius; ++z) {
if ((new BlockVector3(x, oy, z)).distanceSq(position) > radiusSq) {
if ((BlockVector3.at(x, oy, z)).distanceSq(position) > radiusSq) {
continue;
}
for (int y = world.getMaxY(); y >= 1; --y) {
BlockVector3 pt = new BlockVector3(x, y, z);
BlockVector3 pt = BlockVector3.at(x, y, z);
BlockType id = getBlock(pt).getBlockType();
if (id.getMaterial().isAir()) {
@@ -1619,12 +1619,12 @@ public int green(BlockVector3 position, double radius, boolean onlyNormalDirt)
final int ceilRadius = (int) Math.ceil(radius);
for (int x = ox - ceilRadius; x <= ox + ceilRadius; ++x) {
for (int z = oz - ceilRadius; z <= oz + ceilRadius; ++z) {
if ((new BlockVector3(x, oy, z)).distanceSq(position) > radiusSq) {
if ((BlockVector3.at(x, oy, z)).distanceSq(position) > radiusSq) {
continue;
}
for (int y = world.getMaxY(); y >= 1; --y) {
final BlockVector3 pt = new BlockVector3(x, y, z);
final BlockVector3 pt = BlockVector3.at(x, y, z);
final BlockState block = getBlock(pt);
if (block.getBlockType() == BlockTypes.DIRT ||
@@ -1690,7 +1690,7 @@ public int makeForest(BlockVector3 basePosition, int size, double density, TreeG
for (int z = basePosition.getBlockZ() - size; z <= basePosition.getBlockZ()
+ size; ++z) {
// Don't want to be in the ground
if (!getBlock(new BlockVector3(x, basePosition.getBlockY(), z)).getBlockType().getMaterial().isAir()) {
if (!getBlock(BlockVector3.at(x, basePosition.getBlockY(), z)).getBlockType().getMaterial().isAir()) {
continue;
}
// The gods don't want a tree here
@@ -1700,13 +1700,13 @@ public int makeForest(BlockVector3 basePosition, int size, double density, TreeG
for (int y = basePosition.getBlockY(); y >= basePosition.getBlockY() - 10; --y) {
// Check if we hit the ground
BlockType t = getBlock(new BlockVector3(x, y, z)).getBlockType();
BlockType t = getBlock(BlockVector3.at(x, y, z)).getBlockType();
if (t == BlockTypes.GRASS_BLOCK || t == BlockTypes.DIRT) {
treeType.generate(this, new BlockVector3(x, y + 1, z));
treeType.generate(this, BlockVector3.at(x, y + 1, z));
++affected;
break;
} else if (t == BlockTypes.SNOW) {
setBlock(new BlockVector3(x, y, z), BlockTypes.AIR.getDefaultState());
setBlock(BlockVector3.at(x, y, z), BlockTypes.AIR.getDefaultState());
} else if (!t.getMaterial().isAir()) { // Trees won't grow on this!
break;
}
@@ -1743,7 +1743,7 @@ public int makeShape(final Region region, final Vector3 zero, final Vector3 unit
final ArbitraryShape shape = new ArbitraryShape(region) {
@Override
protected BlockStateHolder getMaterial(int x, int y, int z, BlockStateHolder defaultMaterial) {
final Vector3 current = new Vector3(x, y, z);
final Vector3 current = Vector3.at(x, y, z);
environment.setCurrentBlock(current);
final Vector3 scaled = current.subtract(zero).divide(unit);
@@ -1834,22 +1834,22 @@ public int hollowOutRegion(Region region, int thickness, Pattern pattern) throws
for (int x = minX; x <= maxX; ++x) {
for (int y = minY; y <= maxY; ++y) {
recurseHollow(region, new BlockVector3(x, y, minZ), outside);
recurseHollow(region, new BlockVector3(x, y, maxZ), outside);
recurseHollow(region, BlockVector3.at(x, y, minZ), outside);
recurseHollow(region, BlockVector3.at(x, y, maxZ), outside);
}
}
for (int y = minY; y <= maxY; ++y) {
for (int z = minZ; z <= maxZ; ++z) {
recurseHollow(region, new BlockVector3(minX, y, z), outside);
recurseHollow(region, new BlockVector3(maxX, y, z), outside);
recurseHollow(region, BlockVector3.at(minX, y, z), outside);
recurseHollow(region, BlockVector3.at(maxX, y, z), outside);
}
}
for (int z = minZ; z <= maxZ; ++z) {
for (int x = minX; x <= maxX; ++x) {
recurseHollow(region, new BlockVector3(x, minY, z), outside);
recurseHollow(region, new BlockVector3(x, maxY, z), outside);
recurseHollow(region, BlockVector3.at(x, minY, z), outside);
recurseHollow(region, BlockVector3.at(x, maxY, z), outside);
}
}
@@ -1910,7 +1910,7 @@ public int drawLine(Pattern pattern, BlockVector3 pos1, BlockVector3 pos2, doubl
int dx = Math.abs(x2 - x1), dy = Math.abs(y2 - y1), dz = Math.abs(z2 - z1);
if (dx + dy + dz == 0) {
vset.add(new BlockVector3(tipx, tipy, tipz));
vset.add(BlockVector3.at(tipx, tipy, tipz));
notdrawn = false;
}
@@ -1920,7 +1920,7 @@ public int drawLine(Pattern pattern, BlockVector3 pos1, BlockVector3 pos2, doubl
tipy = (int) Math.round(y1 + domstep * ((double) dy) / ((double) dx) * (y2 - y1 > 0 ? 1 : -1));
tipz = (int) Math.round(z1 + domstep * ((double) dz) / ((double) dx) * (z2 - z1 > 0 ? 1 : -1));
vset.add(new BlockVector3(tipx, tipy, tipz));
vset.add(BlockVector3.at(tipx, tipy, tipz));
}
notdrawn = false;
}
@@ -1931,7 +1931,7 @@ public int drawLine(Pattern pattern, BlockVector3 pos1, BlockVector3 pos2, doubl
tipx = (int) Math.round(x1 + domstep * ((double) dx) / ((double) dy) * (x2 - x1 > 0 ? 1 : -1));
tipz = (int) Math.round(z1 + domstep * ((double) dz) / ((double) dy) * (z2 - z1 > 0 ? 1 : -1));
vset.add(new BlockVector3(tipx, tipy, tipz));
vset.add(BlockVector3.at(tipx, tipy, tipz));
}
notdrawn = false;
}
@@ -1942,7 +1942,7 @@ public int drawLine(Pattern pattern, BlockVector3 pos1, BlockVector3 pos2, doubl
tipy = (int) Math.round(y1 + domstep * ((double) dy) / ((double) dz) * (y2-y1>0 ? 1 : -1));
tipx = (int) Math.round(x1 + domstep * ((double) dx) / ((double) dz) * (x2-x1>0 ? 1 : -1));
vset.add(new BlockVector3(tipx, tipy, tipz));
vset.add(BlockVector3.at(tipx, tipy, tipz));
}
notdrawn = false;
}
@@ -2019,7 +2019,7 @@ private static double hypot(double... pars) {
for (int loopy = tipy - ceilrad; loopy <= tipy + ceilrad; loopy++) {
for (int loopz = tipz - ceilrad; loopz <= tipz + ceilrad; loopz++) {
if (hypot(loopx - tipx, loopy - tipy, loopz - tipz) <= radius) {
returnset.add(new BlockVector3(loopx, loopy, loopz));
returnset.add(BlockVector3.at(loopx, loopy, loopz));
}
}
}
@@ -2032,12 +2032,12 @@ private static double hypot(double... pars) {
Set<BlockVector3> returnset = new HashSet<>();
for (BlockVector3 v : vset) {
double x = v.getX(), y = v.getY(), z = v.getZ();
if (!(vset.contains(new BlockVector3(x + 1, y, z)) &&
vset.contains(new BlockVector3(x - 1, y, z)) &&
vset.contains(new BlockVector3(x, y + 1, z)) &&
vset.contains(new BlockVector3(x, y - 1, z)) &&
vset.contains(new BlockVector3(x, y, z + 1)) &&
vset.contains(new BlockVector3(x, y, z - 1)))) {
if (!(vset.contains(BlockVector3.at(x + 1, y, z)) &&
vset.contains(BlockVector3.at(x - 1, y, z)) &&
vset.contains(BlockVector3.at(x, y + 1, z)) &&
vset.contains(BlockVector3.at(x, y - 1, z)) &&
vset.contains(BlockVector3.at(x, y, z + 1)) &&
vset.contains(BlockVector3.at(x, y, z - 1)))) {
returnset.add(v);
}
}
@@ -2083,7 +2083,7 @@ public int makeBiomeShape(final Region region, final Vector3 zero, final Vector3
final ArbitraryBiomeShape shape = new ArbitraryBiomeShape(region) {
@Override
protected BaseBiome getBiome(int x, int z, BaseBiome defaultBiomeType) {
final Vector2 current = new Vector2(x, z);
final Vector2 current = Vector2.at(x, z);
environment.setCurrentBlock(current.toVector3(0));
final Vector2 scaled = current.subtract(zero2D).divide(unit2D);
@@ -662,7 +662,7 @@ public void updateServerCUI(Actor actor) {
if (block != null) {
// If it's null, we don't need to do anything. The old was already removed.
Map<String, Tag> tags = block.getNbtData().getValue();
cuiTemporaryBlock = new BlockVector3(
cuiTemporaryBlock = BlockVector3.at(
((IntTag) tags.get("x")).getValue(),
((IntTag) tags.get("y")).getValue(),
((IntTag) tags.get("z")).getValue()
@@ -29,16 +29,16 @@
*/
public enum PlayerDirection {
NORTH(new Vector3(0, 0, -1), true),
NORTH_EAST((new Vector3(1, 0, -1)).normalize(), false),
EAST(new Vector3(1, 0, 0), true),
SOUTH_EAST((new Vector3(1, 0, 1)).normalize(), false),
SOUTH(new Vector3(0, 0, 1), true),
SOUTH_WEST((new Vector3(-1, 0, 1)).normalize(), false),
WEST(new Vector3(-1, 0, 0), true),
NORTH_WEST((new Vector3(-1, 0, -1)).normalize(), false),
UP(new Vector3(0, 1, 0), true),
DOWN(new Vector3(0, -1, 0), true);
NORTH(Vector3.at(0, 0, -1), true),
NORTH_EAST((Vector3.at(1, 0, -1)).normalize(), false),
EAST(Vector3.at(1, 0, 0), true),
SOUTH_EAST((Vector3.at(1, 0, 1)).normalize(), false),
SOUTH(Vector3.at(0, 0, 1), true),
SOUTH_WEST((Vector3.at(-1, 0, 1)).normalize(), false),
WEST(Vector3.at(-1, 0, 0), true),
NORTH_WEST((Vector3.at(-1, 0, -1)).normalize(), false),
UP(Vector3.at(0, 1, 0), true),
DOWN(Vector3.at(0, -1, 0), true);
private final Vector3 dir;
private final boolean isOrthogonal;
@@ -76,7 +76,7 @@ public void chunkInfo(Player player, LocalSession session, EditSession editSessi
player.print("Chunk: " + chunkX + ", " + chunkZ);
player.print("Old format: " + folder1 + "/" + folder2 + "/" + filename);
player.print("McRegion: region/" + McRegionChunkStore.getFilename(
new BlockVector2(chunkX, chunkZ)));
BlockVector2.at(chunkX, chunkZ)));
}
@Command(
Oops, something went wrong.

0 comments on commit 2c8b2fe

Please sign in to comment.