3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 02:20:07 +01:00

Fix issue with offset/origin when pasting a clipboard via API without wrapping into a BlockArrayClipboard

Dieser Commit ist enthalten in:
dordsor21 2021-12-30 16:05:16 +00:00
Ursprung f30ea96268
Commit 0994ea1e67
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
3 geänderte Dateien mit 11 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -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();
}

Datei anzeigen

@ -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

Datei anzeigen

@ -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) {