mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Fix issue with offset/origin when pasting a clipboard via API without wrapping into a BlockArrayClipboard
This commit is contained in:
parent
f30ea96268
commit
0994ea1e67
@ -220,13 +220,17 @@ public class FaweDelegateRegionManager {
|
||||
Clipboard clipB = Clipboard.create(regionB, UUID.randomUUID());
|
||||
ForwardExtentCopy copyA = new ForwardExtentCopy(sessionA, regionA, clipA, clipA.getMinimumPoint());
|
||||
ForwardExtentCopy copyB = new ForwardExtentCopy(sessionB, regionB, clipB, clipB.getMinimumPoint());
|
||||
copyA.setCopyingBiomes(true);
|
||||
copyB.setCopyingBiomes(true);
|
||||
try {
|
||||
Operations.completeLegacy(copyA);
|
||||
Operations.completeLegacy(copyB);
|
||||
clipA.paste(sessionB, swapPos.getBlockVector3(), true);
|
||||
clipB.paste(sessionA, pos1.getBlockVector3(), true);
|
||||
sessionA.flushQueue();
|
||||
sessionB.flushQueue();
|
||||
clipA.flush();
|
||||
clipB.flush();
|
||||
clipA.paste(sessionB, swapPos.getBlockVector3(), true, true, true);
|
||||
clipB.paste(sessionA, pos1.getBlockVector3(), true, true, true);
|
||||
sessionA.close();
|
||||
sessionB.close();
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
|
||||
int offsetZ = byteBuffer.getShort(20);
|
||||
region.shift(BlockVector3.at(offsetX, offsetY, offsetZ));
|
||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(region, this);
|
||||
clipboard.setOrigin(getOrigin());
|
||||
clipboard.setOrigin(getOrigin().add(offset));
|
||||
return clipboard;
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
@ -289,7 +289,7 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
|
||||
int ox = byteBuffer.getShort(10);
|
||||
int oy = byteBuffer.getShort(12);
|
||||
int oz = byteBuffer.getShort(14);
|
||||
return BlockVector3.at(ox, oy, oz);
|
||||
return BlockVector3.at(ox, oy, oz).subtract(offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,10 +7,10 @@ import com.sk89q.worldedit.regions.Region;
|
||||
|
||||
public abstract class SimpleClipboard implements Clipboard {
|
||||
|
||||
protected BlockVector3 offset;
|
||||
private final BlockVector3 size;
|
||||
private final int area;
|
||||
private final int volume;
|
||||
private BlockVector3 offset;
|
||||
private BlockVector3 origin;
|
||||
|
||||
SimpleClipboard(BlockVector3 dimensions, BlockVector3 offset) {
|
||||
|
Loading…
Reference in New Issue
Block a user