3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 02:50:05 +01:00

If extent is world when pasting clipboard, cretae editsession

fixes #583
Dieser Commit ist enthalten in:
dordsor21 2020-10-01 15:02:34 +01:00
Ursprung 987ab7d2b6
Commit 40717c23c4
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -272,6 +272,12 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
default void paste(Extent extent, BlockVector3 to, boolean pasteAir, default void paste(Extent extent, BlockVector3 to, boolean pasteAir,
@Nullable Transform transform) { @Nullable Transform transform) {
if (extent instanceof World) {
EditSessionBuilder builder = new EditSessionBuilder((World) extent).autoQueue(true)
.checkMemory(false).allowedRegionsEverywhere().limitUnlimited().changeSetNull();
extent = builder.build();
}
Extent source = this; Extent source = this;
if (transform != null && !transform.isIdentity()) { if (transform != null && !transform.isIdentity()) {
source = new BlockTransformExtent(this, transform); source = new BlockTransformExtent(this, transform);
@ -302,6 +308,12 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
} }
default void paste(Extent extent, BlockVector3 to, boolean pasteAir, boolean pasteEntities, boolean pasteBiomes) { default void paste(Extent extent, BlockVector3 to, boolean pasteAir, boolean pasteEntities, boolean pasteBiomes) {
if (extent instanceof World) {
EditSessionBuilder builder = new EditSessionBuilder((World) extent).autoQueue(true)
.checkMemory(false).allowedRegionsEverywhere().limitUnlimited().changeSetNull();
extent = builder.build();
}
final BlockVector3 origin = this.getOrigin(); final BlockVector3 origin = this.getOrigin();
// To must be relative to the clipboard origin ( player location - clipboard origin ) (as the locations supplied are relative to the world origin) // To must be relative to the clipboard origin ( player location - clipboard origin ) (as the locations supplied are relative to the world origin)