Use BlockArrayClipboard for schem load

Dieser Commit ist enthalten in:
Jesse Boyd 2019-11-12 12:41:39 +00:00
Ursprung cfa147cf76
Commit ac6f4ae358
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F
2 geänderte Dateien mit 14 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -60,6 +60,13 @@ public class BlockArrayClipboard extends DelegateClipboard implements Clipboard,
this(region, UUID.randomUUID()); this(region, UUID.randomUUID());
} }
public BlockArrayClipboard(Clipboard clipboard, BlockVector3 offset) {
super(clipboard);
Region shifted = clipboard.getRegion();
shifted.shift(offset);
setRegion(shifted);
}
/** /**
* Create a new instance. * Create a new instance.
* *

Datei anzeigen

@ -218,10 +218,9 @@ public class SpongeSchematicReader extends NBTSchematicReader {
biomes = null; biomes = null;
BlockVector3 dimensions = BlockVector3.at(width, height, length); BlockVector3 dimensions = BlockVector3.at(width, height, length);
BlockVector3 origin = min; BlockVector3 origin = BlockVector3.ZERO;
if (offsetX != Integer.MIN_VALUE && offsetY != Integer.MIN_VALUE && offsetZ != Integer.MIN_VALUE) { if (offsetX != Integer.MIN_VALUE && offsetY != Integer.MIN_VALUE && offsetZ != Integer.MIN_VALUE) {
// origin = origin.subtract(BlockVector3.at(offsetX, offsetY, offsetZ)); origin = BlockVector3.at(-offsetX, -offsetY, -offsetZ);
origin = BlockVector3.at(offsetX, offsetY, offsetZ);
} }
Clipboard clipboard = createOutput.apply(dimensions); Clipboard clipboard = createOutput.apply(dimensions);
@ -341,6 +340,11 @@ public class SpongeSchematicReader extends NBTSchematicReader {
} }
} }
clipboard.setOrigin(origin); clipboard.setOrigin(origin);
if (!min.equals(BlockVector3.ZERO)) {
new BlockArrayClipboard(clipboard, min);
}
return clipboard; return clipboard;
} }