Fix incorrect x/y/z stuff;

Fixes #616
Fixes #614
This commit is contained in:
dordsor21 2020-09-14 20:16:46 +01:00
parent 3d2052b0c8
commit 07a5ef5ab4
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
2 changed files with 6 additions and 11 deletions

View File

@ -2939,7 +2939,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
protected BiomeType getBiome(int x, int y, int z, BiomeType defaultBiomeType) { protected BiomeType getBiome(int x, int y, int z, BiomeType defaultBiomeType) {
environment.setCurrentBlock(x, y, z); environment.setCurrentBlock(x, y, z);
double scaledX = (x - zero.getX()) / unit.getX(); double scaledX = (x - zero.getX()) / unit.getX();
double scaledY = (x - zero.getY()) / unit.getX(); double scaledY = (y - zero.getY()) / unit.getY();
double scaledZ = (z - zero.getZ()) / unit.getZ(); double scaledZ = (z - zero.getZ()) / unit.getZ();
try { try {

View File

@ -311,18 +311,13 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
pasteBiomes &= Clipboard.this.hasBiomes(); pasteBiomes &= Clipboard.this.hasBiomes();
MutableBlockVector3 blockVector3 = new MutableBlockVector3();
blockVector3.setComponents(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
for (BlockVector3 pos : this) { for (BlockVector3 pos : this) {
BaseBlock block = pos.getFullBlock(this); BaseBlock block = pos.getFullBlock(this);
int xx = pos.getX() + relx; int xx = pos.getX() + relx;
int yy = pos.getZ() + relz; int yy = pos.getY() + rely;
int zz = pos.getY() + rely; int zz = pos.getZ() + relz;
if (hasBiomes() && pos.getBlockY() == 0) { if (pasteBiomes) {
if (pasteBiomes && (xx != blockVector3.getBlockX() || zz != blockVector3.getBlockZ())) { extent.setBiome(xx, yy, zz, Clipboard.this.getBiome(BlockVector3.at(pos.getX(), pos.getY(), pos.getZ())));
blockVector3.setComponents(xx, yy, zz);
extent.setBiome(blockVector3, Clipboard.this.getBiome(BlockVector3.at(pos.getX(), pos.getY(), pos.getZ())));
}
} }
if (!pasteAir && block.getBlockType().getMaterial().isAir()) { if (!pasteAir && block.getBlockType().getMaterial().isAir()) {
continue; continue;
@ -330,7 +325,7 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
if (pos.getY() < 0) { if (pos.getY() < 0) {
throw new RuntimeException("Y-Position cannot be less than 0!"); throw new RuntimeException("Y-Position cannot be less than 0!");
} }
extent.setBlock(xx, pos.getY() + rely, zz, block); extent.setBlock(xx, yy, zz, block);
} }
// Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin) // Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin)
final int entityOffsetX = to.getBlockX() - origin.getBlockX(); final int entityOffsetX = to.getBlockX() - origin.getBlockX();