From 6f5430a940e6f1d2bba5e08a049cf538a79bf655 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 11 Aug 2021 14:00:12 +0100 Subject: [PATCH] Some cleanup of mutables --- .../core/extent/BlockTranslateExtent.java | 9 +-- .../core/extent/SourceMaskExtent.java | 2 +- .../io/schematic/MinecraftStructure.java | 1 - .../heightmap/ScalableHeightMap.java | 3 +- .../processor/lighting/NMSRelighter.java | 1 + .../core/extent/transform/ScaleTransform.java | 61 +++++++++---------- .../core/function/mask/AngleMask.java | 4 -- .../pattern/RandomFullClipboardPattern.java | 5 +- .../pattern/SurfaceRandomOffsetPattern.java | 2 +- .../core/math/BlockVector3ChunkMap.java | 2 +- .../core/math/LocalBlockVectorSet.java | 1 - .../java/com/sk89q/worldedit/EditSession.java | 17 +++--- .../com/sk89q/worldedit/extent/Extent.java | 18 +++--- .../worldedit/function/mask/NoiseFilter.java | 13 +++- 14 files changed, 70 insertions(+), 69 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java index 71b56c87a..3b148ac26 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java @@ -1,6 +1,5 @@ package com.fastasyncworldedit.core.extent; -import com.fastasyncworldedit.core.math.MutableBlockVector3; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; @@ -15,7 +14,6 @@ public class BlockTranslateExtent extends AbstractDelegateExtent { private final int dx; private final int dy; private final int dz; - private final MutableBlockVector3 mutable = new MutableBlockVector3(); public BlockTranslateExtent(Extent extent, int dx, int dy, int dz) { super(extent); @@ -26,15 +24,12 @@ public class BlockTranslateExtent extends AbstractDelegateExtent { @Override public > boolean setBlock(BlockVector3 location, T block) throws WorldEditException { - mutable.mutX(location.getX() + dx); - mutable.mutY(location.getY() + dy); - mutable.mutZ(location.getZ() + dz); - return getExtent().setBlock(mutable, block); + return getExtent().setBlock(location.getX(), location.getY(), location.getZ(), block); } @Override public > boolean setBlock(int x, int y, int z, T block) throws WorldEditException { - return this.setBlock(BlockVector3.at(x, y, z), block); + return getExtent().setBlock(x, y, z, block); } @Override diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java index 333ea30bb..6c2230372 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java @@ -42,7 +42,7 @@ public class SourceMaskExtent extends TemporalExtent { @Override public > boolean setBlock(BlockVector3 location, T block) throws WorldEditException { set(location.getBlockX(), location.getBlockY(), location.getBlockZ(), block); - return mask.test(location) && super.setBlock(location, block); + return mask.test(location) && super.setBlock(location.getX(), location.getY(), location.getZ(), block); } @Override diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/MinecraftStructure.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/MinecraftStructure.java index 852958c98..6821ebd48 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/MinecraftStructure.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/MinecraftStructure.java @@ -167,7 +167,6 @@ public class MinecraftStructure implements ClipboardReader, ClipboardWriter { } Map structure = FaweCache.IMP.asMap("version", 1, "author", owner); // ignored: version / owner - MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0); Int2ObjectArrayMap indexes = new Int2ObjectArrayMap<>(); // Size structure.put("size", Arrays.asList(width, height, length)); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ScalableHeightMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ScalableHeightMap.java index d384bd416..00b05e894 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ScalableHeightMap.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ScalableHeightMap.java @@ -68,6 +68,7 @@ public class ScalableHeightMap implements HeightMap { int maxY = clipboard.getMaximumPoint().getBlockY(); int clipHeight = maxY - minY + 1; HashSet visited = new HashSet<>(); + MutableBlockVector3 bv = new MutableBlockVector3(); for (BlockVector3 pos : clipboard.getRegion()) { IntPair pair = new IntPair(pos.getBlockX(), pos.getBlockZ()); if (visited.contains(pair)) { @@ -77,7 +78,7 @@ public class ScalableHeightMap implements HeightMap { int xx = pos.getBlockX(); int zz = pos.getBlockZ(); int highestY = minY; - MutableBlockVector3 bv = new MutableBlockVector3(pos); + bv.setComponents(pos); for (int y = minY; y <= maxY; y++) { bv.mutY(y); BlockState block = clipboard.getBlock(bv); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/lighting/NMSRelighter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/lighting/NMSRelighter.java index 800da9be0..385f2292e 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/lighting/NMSRelighter.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/lighting/NMSRelighter.java @@ -807,6 +807,7 @@ public class NMSRelighter implements Relighter { if (current != 0 && current < currentLight) { iChunk.setBlockLight(x, y, z, 0); if (current > 1) { + mutableBlockPos.setComponents(x, y, z); if (!visited.containsKey(mutableBlockPos)) { MutableBlockVector3 index = new MutableBlockVector3(x, y, z); visited.put(index, present); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/transform/ScaleTransform.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/transform/ScaleTransform.java index c246fd9ce..33053813b 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/transform/ScaleTransform.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/transform/ScaleTransform.java @@ -39,24 +39,22 @@ public class ScaleTransform extends ResettableExtent { return super.setExtent(extent); } - private BlockVector3 getPos(BlockVector3 pos) { + private void getPos(BlockVector3 pos) { if (min == null) { min = pos; } mutable.mutX(min.getX() + (pos.getX() - min.getX()) * dx); mutable.mutY(min.getY() + (pos.getY() - min.getY()) * dy); mutable.mutZ(min.getZ() + (pos.getZ() - min.getZ()) * dz); - return mutable; } - private BlockVector3 getPos(int x, int y, int z) { + private void getPos(int x, int y, int z) { if (min == null) { min = BlockVector3.at(x, y, z); } mutable.mutX(min.getX() + (x - min.getX()) * dx); mutable.mutY(min.getY() + (y - min.getY()) * dy); mutable.mutZ(min.getZ() + (z - min.getZ()) * dz); - return mutable; } @@ -64,17 +62,17 @@ public class ScaleTransform extends ResettableExtent { public > boolean setBlock(BlockVector3 location, B block) throws WorldEditException { boolean result = false; - MutableBlockVector3 pos = new MutableBlockVector3(getPos(location)); - double sx = pos.getX(); - double sy = pos.getY(); - double sz = pos.getZ(); + getPos(location); + double sx = mutable.getX(); + double sy = mutable.getY(); + double sz = mutable.getZ(); double ex = sx + dx; double ey = Math.min(maxy, sy + dy); double ez = sz + dz; - for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) { - for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) { - for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) { - result |= super.setBlock(pos, block); + for (mutable.mutY(sy); mutable.getY() < ey; mutable.mutY(mutable.getY() + 1)) { + for (mutable.mutZ(sz); mutable.getZ() < ez; mutable.mutZ(mutable.getZ() + 1)) { + for (mutable.mutX(sx); mutable.getX() < ex; mutable.mutX(mutable.getX() + 1)) { + result |= super.setBlock(mutable, block); } } } @@ -84,17 +82,17 @@ public class ScaleTransform extends ResettableExtent { @Override public boolean setBiome(BlockVector3 position, BiomeType biome) { boolean result = false; - MutableBlockVector3 pos = new MutableBlockVector3(getPos(position)); - double sx = pos.getX(); - double sy = pos.getY(); - double sz = pos.getZ(); + getPos(position); + double sx = mutable.getX(); + double sy = mutable.getY(); + double sz = mutable.getZ(); double ex = sx + dx; double ey = Math.min(maxy, sy + dy); double ez = sz + dz; - for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) { - for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) { - for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) { - result |= super.setBiome(pos, biome); + for (mutable.mutY(sy); mutable.getY() < ey; mutable.mutY(mutable.getY() + 1)) { + for (mutable.mutZ(sz); mutable.getZ() < ez; mutable.mutZ(mutable.getZ() + 1)) { + for (mutable.mutX(sx); mutable.getX() < ex; mutable.mutX(mutable.getX() + 1)) { + result |= super.setBiome(mutable, biome); } } } @@ -105,17 +103,17 @@ public class ScaleTransform extends ResettableExtent { public > boolean setBlock(int x1, int y1, int z1, B block) throws WorldEditException { boolean result = false; - MutableBlockVector3 pos = new MutableBlockVector3(getPos(x1, y1, z1)); - double sx = pos.getX(); - double sy = pos.getY(); - double sz = pos.getZ(); - double ex = pos.getX() + dx; + getPos(x1, y1, z1); + double sx = mutable.getX(); + double sy = mutable.getY(); + double sz = mutable.getZ(); + double ex = mutable.getX() + dx; double ey = Math.min(maxy, sy + dy); - double ez = pos.getZ() + dz; - for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) { - for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) { - for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) { - result |= super.setBlock(pos, block); + double ez = mutable.getZ() + dz; + for (mutable.mutY(sy); mutable.getY() < ey; mutable.mutY(mutable.getY() + 1)) { + for (mutable.mutZ(sz); mutable.getZ() < ez; mutable.mutZ(mutable.getZ() + 1)) { + for (mutable.mutX(sx); mutable.getX() < ex; mutable.mutX(mutable.getX() + 1)) { + result |= super.setBlock(mutable, block); } } } @@ -125,8 +123,9 @@ public class ScaleTransform extends ResettableExtent { @Nullable @Override public Entity createEntity(Location location, BaseEntity entity) { + getPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()); Location newLoc = new Location(location.getExtent(), - getPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()).toVector3(), + mutable.toVector3(), location.getYaw(), location.getPitch() ); return super.createEntity(newLoc, entity); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/mask/AngleMask.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/mask/AngleMask.java index 83b0ada14..10c73bd80 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/mask/AngleMask.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/mask/AngleMask.java @@ -1,6 +1,5 @@ package com.fastasyncworldedit.core.function.mask; -import com.fastasyncworldedit.core.math.MutableBlockVector3; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.SolidBlockMask; @@ -21,8 +20,6 @@ public class AngleMask extends SolidBlockMask implements ResettableMask { protected final int maxY; protected final int distance; - protected transient MutableBlockVector3 mutable = new MutableBlockVector3(); - public AngleMask(Extent extent, double min, double max, boolean overlay, int distance) { super(extent); this.mask = new CachedMask(new SolidBlockMask(extent)); @@ -36,7 +33,6 @@ public class AngleMask extends SolidBlockMask implements ResettableMask { @Override public void reset() { - mutable = new MutableBlockVector3(); cacheBotX = Integer.MIN_VALUE; cacheBotZ = Integer.MIN_VALUE; lastX = Integer.MIN_VALUE; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/pattern/RandomFullClipboardPattern.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/pattern/RandomFullClipboardPattern.java index a8d67b5ed..e34d16a7b 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/pattern/RandomFullClipboardPattern.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/pattern/RandomFullClipboardPattern.java @@ -1,6 +1,5 @@ package com.fastasyncworldedit.core.function.pattern; -import com.fastasyncworldedit.core.math.MutableBlockVector3; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.clipboard.Clipboard; @@ -20,10 +19,10 @@ import static com.google.common.base.Preconditions.checkNotNull; public class RandomFullClipboardPattern extends AbstractPattern { private final Extent extent; - private final MutableBlockVector3 mutable = new MutableBlockVector3(); private final List clipboards; private final boolean randomRotate; private final boolean randomFlip; + private final Vector3 flipVector = Vector3.at(1, 0, 0).multiply(-2).add(1, 1, 1); public RandomFullClipboardPattern(Extent extent, List clipboards, boolean randomRotate, boolean randomFlip) { checkNotNull(clipboards); @@ -42,7 +41,7 @@ public class RandomFullClipboardPattern extends AbstractPattern { holder.setTransform(new AffineTransform().rotateY(ThreadLocalRandom.current().nextInt(4) * 90)); } if (randomFlip) { - transform = transform.scale(Vector3.at(1, 0, 0).multiply(-2).add(1, 1, 1)); + transform = transform.scale(flipVector); } if (!transform.isIdentity()) { holder.setTransform(transform); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/pattern/SurfaceRandomOffsetPattern.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/pattern/SurfaceRandomOffsetPattern.java index aff9b51cd..2769c5f05 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/pattern/SurfaceRandomOffsetPattern.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/pattern/SurfaceRandomOffsetPattern.java @@ -36,9 +36,9 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern { private BlockVector3 travel(BlockVector3 pos) { cur.setComponents(pos); + MutableBlockVector3 next; for (int move = 0; move < moves; move++) { int index = 0; - MutableBlockVector3 next; for (int i = 0; i < allowed.length; i++) { next = buffer[i]; BlockVector3 dir = BreadthFirstSearch.DIAGONAL_DIRECTIONS[i]; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/BlockVector3ChunkMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/BlockVector3ChunkMap.java index f36bd8f51..49dc09e27 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/BlockVector3ChunkMap.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/BlockVector3ChunkMap.java @@ -26,7 +26,7 @@ public class BlockVector3ChunkMap implements IAdaptedMap { public void forEach(BlockVectorSetVisitor visitor) { int size = size(); int index = -1; - BlockVector3 mVec = MutableBlockVector3.get(0, 0, 0); for (int i = 0; i < size; i++) { index = set.nextSetBit(index + 1); int b1 = (index & 0xFF); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 08b81462c..9d47ffe3f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -2079,7 +2079,6 @@ public class EditSession extends PassthroughExtent implements AutoCloseable { int px = mutableBlockVector3.getBlockX(); int py = mutableBlockVector3.getBlockY(); int pz = mutableBlockVector3.getBlockZ(); - MutableBlockVector3 mutable = new MutableBlockVector3(); final int ceilRadiusX = (int) Math.ceil(radiusX); final int ceilRadiusZ = (int) Math.ceil(radiusZ); @@ -2122,10 +2121,10 @@ public class EditSession extends PassthroughExtent implements AutoCloseable { } for (int y = 0; y < height; ++y) { - this.setBlock(mutable.setComponents(px + x, py + y, pz + z), block); - this.setBlock(mutable.setComponents(px - x, py + y, pz + z), block); - this.setBlock(mutable.setComponents(px + x, py + y, pz - z), block); - this.setBlock(mutable.setComponents(px - x, py + y, pz - z), block); + this.setBlock(mutableBlockVector3.setComponents(px + x, py + y, pz + z), block); + this.setBlock(mutableBlockVector3.setComponents(px - x, py + y, pz + z), block); + this.setBlock(mutableBlockVector3.setComponents(px + x, py + y, pz - z), block); + this.setBlock(mutableBlockVector3.setComponents(px - x, py + y, pz - z), block); } } } @@ -2158,10 +2157,10 @@ public class EditSession extends PassthroughExtent implements AutoCloseable { for (int y = 0; y < height; ++y) { //FAWE start - mutable - this.setBlock(mutable.setComponents(px + x, py + y, pz + z), block); - this.setBlock(mutable.setComponents(px - x, py + y, pz + z), block); - this.setBlock(mutable.setComponents(px + x, py + y, pz - z), block); - this.setBlock(mutable.setComponents(px - x, py + y, pz - z), block); + this.setBlock(mutableBlockVector3.setComponents(px + x, py + y, pz + z), block); + this.setBlock(mutableBlockVector3.setComponents(px - x, py + y, pz + z), block); + this.setBlock(mutableBlockVector3.setComponents(px + x, py + y, pz - z), block); + this.setBlock(mutableBlockVector3.setComponents(px - x, py + y, pz - z), block); //FAWE end } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java index f07cf4b34..eb734cce5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java @@ -213,10 +213,11 @@ public interface Extent extends InputExtent, OutputExtent { } default int getHighestTerrainBlock(final int x, final int z, int minY, int maxY, Mask filter) { - maxY = Math.min(maxY, Math.max(0, maxY)); - minY = Math.max(0, minY); + maxY = Math.min(maxY, getMaxY()); + minY = Math.max(getMinY(), minY); + BlockVector3 pos = MutableBlockVector3.at(x, minY, z); for (int y = maxY; y >= minY; --y) { - if (filter.test(MutableBlockVector3.get(x, y, z))) { + if (filter.test(pos.mutY(y))) { return y; } } @@ -286,28 +287,29 @@ public interface Extent extends InputExtent, OutputExtent { int clearanceAbove = maxY - y; int clearanceBelow = y - minY; int clearance = Math.min(clearanceAbove, clearanceBelow); - boolean state = !mask.test(MutableBlockVector3.get(x, y, z)); + BlockVector3 pos = MutableBlockVector3.get(x, y, z); + boolean state = !mask.test(pos); int offset = state ? 0 : 1; for (int d = 0; d <= clearance; d++) { int y1 = y + d; - if (mask.test(MutableBlockVector3.get(x, y1, z)) != state) { + if (mask.test(pos.mutY(y1)) != state) { return y1 - offset; } int y2 = y - d; - if (mask.test(MutableBlockVector3.get(x, y2, z)) != state) { + if (mask.test(pos.mutY(y2)) != state) { return y2 + offset; } } if (clearanceAbove != clearanceBelow) { if (clearanceAbove < clearanceBelow) { for (int layer = y - clearance - 1; layer >= minY; layer--) { - if (mask.test(MutableBlockVector3.get(x, layer, z)) != state) { + if (mask.test(pos.mutY(layer)) != state) { return layer + offset; } } } else { for (int layer = y + clearance + 1; layer <= maxY; layer++) { - if (mask.test(MutableBlockVector3.get(x, layer, z)) != state) { + if (mask.test(pos.mutY(layer)) != state) { return layer - offset; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java index 2742942e0..684148505 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java @@ -34,6 +34,9 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class NoiseFilter extends AbstractMask { + //FAWE start - mutable + private MutableVector3 mutable; + //FAWE end private NoiseGenerator noiseGenerator; private double density; @@ -65,6 +68,9 @@ public class NoiseFilter extends AbstractMask { public void setNoiseGenerator(NoiseGenerator noiseGenerator) { checkNotNull(noiseGenerator); this.noiseGenerator = noiseGenerator; + //FAWE start - mutable + this.mutable = new MutableVector3(); + //FAWE end } /** @@ -83,11 +89,16 @@ public class NoiseFilter extends AbstractMask { checkArgument(density >= 0, "density must be >= 0"); checkArgument(density <= 1, "density must be <= 1"); this.density = density; + //FAWE start - mutable + this.mutable = new MutableVector3(); + //FAWE end } @Override public boolean test(BlockVector3 vector) { - return noiseGenerator.noise(MutableVector3.get(vector.getX(), vector.getY(), vector.getZ())) <= density; + //FAWE start - mutable + return noiseGenerator.noise(mutable.setComponents(vector.getX(), vector.getZ(), vector.getZ())) <= density; + //FAWE end } @Nullable