mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 08:18:35 +00:00
Use more MutableBlockVector3s
This commit is contained in:
@ -213,11 +213,13 @@ 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, getMaxY());
|
||||
minY = Math.max(getMinY(), minY);
|
||||
BlockVector3 pos = MutableBlockVector3.at(x, minY, z);
|
||||
maxY = Math.min(maxY, Math.max(0, maxY));
|
||||
minY = Math.max(0, minY);
|
||||
|
||||
MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
for (int y = maxY; y >= minY; --y) {
|
||||
if (filter.test(pos.mutY(y))) {
|
||||
if (filter.test(mutable.setComponents(x, y, z))) {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
|
@ -157,8 +157,9 @@ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pat
|
||||
max = max.getMaximum(BlockVector3.at(x, y, z));
|
||||
}
|
||||
|
||||
if (mask.test(BlockVector3.at(x, y, z))) {
|
||||
biomeBuffer.put(BlockVector3.at(x, y, z), biome);
|
||||
BlockVector3 pos = BlockVector3.at(x, y, z);
|
||||
if (mask.test(pos)) {
|
||||
biomeBuffer.put(pos, biome);
|
||||
return true;
|
||||
} else {
|
||||
return getExtent().setBiome(x, y, z, biome);
|
||||
|
@ -342,7 +342,7 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
|
||||
int yy = pos.getY() + rely;
|
||||
int zz = pos.getZ() + relz;
|
||||
if (pasteBiomes) {
|
||||
extent.setBiome(xx, yy, zz, Clipboard.this.getBiome(BlockVector3.at(pos.getX(), pos.getY(), pos.getZ())));
|
||||
extent.setBiome(xx, yy, zz, Clipboard.this.getBiome(pos));
|
||||
}
|
||||
if (!pasteAir && block.getBlockType().getMaterial().isAir()) {
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user