mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-15 01:08:35 +00:00
Implement biomes to filter blocks and use in Clipboard pasting (#1743)
- Fixes #1741
This commit is contained in:
@ -227,8 +227,13 @@ public class BlockArrayClipboard implements Clipboard {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector3 position) {
|
||||
BlockVector3 v = position.subtract(offset);
|
||||
return getParent().getBiomeType(v.getX(), v.getY(), v.getZ());
|
||||
if (!region.contains(position)) {
|
||||
return null;
|
||||
}
|
||||
int x = position.getBlockX() - offset.getX();
|
||||
int y = position.getBlockY() - offset.getY();
|
||||
int z = position.getBlockZ() - offset.getZ();
|
||||
return getParent().getBiomeType(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -326,6 +331,7 @@ public class BlockArrayClipboard implements Clipboard {
|
||||
@Override
|
||||
public BiomeType getBiomeType(int x, int y, int z) {
|
||||
x -= offset.getX();
|
||||
y -= offset.getY();
|
||||
z -= offset.getZ();
|
||||
return getParent().getBiomeType(x, y, z);
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable, Fl
|
||||
int yy = pos.getY() + rely;
|
||||
int zz = pos.getZ() + relz;
|
||||
if (pasteBiomes) {
|
||||
extent.setBiome(xx, yy, zz, Clipboard.this.getBiome(pos));
|
||||
extent.setBiome(xx, yy, zz, pos.getBiome(this));
|
||||
}
|
||||
if (!pasteAir && block.getBlockType().getMaterial().isAir()) {
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user