3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-19 09:20:08 +01:00

fix: don't require WEOrigin / WEOffset in MCEdit schematics

Dieser Commit ist enthalten in:
Pierre Maurice Schwang 2024-09-30 22:47:21 +02:00
Ursprung 7192e147d0
Commit 205fd3a77b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 37E613079F3E5BB9

Datei anzeigen

@ -57,6 +57,7 @@ import java.io.UncheckedIOException;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.NoSuchElementException;
import java.util.Set; import java.util.Set;
/** /**
@ -126,6 +127,7 @@ public class MCEditSchematicReader extends NBTSchematicReader {
short height = schematicTag.getTag("Height", LinTagType.shortTag()).valueAsShort(); short height = schematicTag.getTag("Height", LinTagType.shortTag()).valueAsShort();
short length = schematicTag.getTag("Length", LinTagType.shortTag()).valueAsShort(); short length = schematicTag.getTag("Length", LinTagType.shortTag()).valueAsShort();
try {
int originX = schematicTag.getTag("WEOriginX", LinTagType.intTag()).valueAsInt(); int originX = schematicTag.getTag("WEOriginX", LinTagType.intTag()).valueAsInt();
int originY = schematicTag.getTag("WEOriginY", LinTagType.intTag()).valueAsInt(); int originY = schematicTag.getTag("WEOriginY", LinTagType.intTag()).valueAsInt();
int originZ = schematicTag.getTag("WEOriginZ", LinTagType.intTag()).valueAsInt(); int originZ = schematicTag.getTag("WEOriginZ", LinTagType.intTag()).valueAsInt();
@ -138,6 +140,12 @@ public class MCEditSchematicReader extends NBTSchematicReader {
origin = min.subtract(offset); origin = min.subtract(offset);
region = new CuboidRegion(min, min.add(width, height, length).subtract(BlockVector3.ONE)); region = new CuboidRegion(min, min.add(width, height, length).subtract(BlockVector3.ONE));
} catch (NoSuchElementException e) {
origin = BlockVector3.ZERO;
region = new CuboidRegion(origin, origin.add(width, height, length).subtract(BlockVector3.ONE));
}
// ==================================================================== // ====================================================================
// Blocks // Blocks