3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-19 09:20:08 +01:00
Dieser Commit ist enthalten in:
Pierre Maurice Schwang 2024-06-23 18:06:02 +02:00
Ursprung c039ae8b9b
Commit 510dee4a49
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 37E613079F3E5BB9
3 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -58,10 +58,6 @@ import java.util.function.BooleanSupplier;
import java.util.function.Function;
import java.util.zip.GZIPInputStream;
/**
* TODO: fix tile entity locations (+ validate entity location)
*/
/**
* ClipboardReader for the Sponge Schematic Format v3.
* Not necessarily much faster than {@link com.sk89q.worldedit.extent.clipboard.io.sponge.SpongeSchematicV3Reader}, but uses a
@ -350,7 +346,6 @@ public class FastSchematicReaderV3 implements ClipboardReader {
final NBTOutputStream cacheStream = new NBTOutputStream(this.getDataCacheWriter());
cacheStream.writeByte(CACHE_IDENTIFIER_ENTITIES);
cacheStream.writeTagPayload(this.nbtInputStream.readTagPayload(NBTConstants.TYPE_LIST, 0));
System.out.println("Wrote entities to cache");
return;
}
if (this.dataInputStream.read() != NBTConstants.TYPE_COMPOUND) {
@ -437,6 +432,7 @@ public class FastSchematicReaderV3 implements ClipboardReader {
if (!stream.readUTF().equals("Data")) {
throw new IOException("Expected COMPOUND tag to be Data");
}
//noinspection deprecation
tag = ((CompoundTag) nbtStream.readTagPayload(NBTConstants.TYPE_COMPOUND, 0)).asBinaryTag();
}
default -> throw new IOException("Unexpected tag in compound: " + type);
@ -631,6 +627,7 @@ public class FastSchematicReaderV3 implements ClipboardReader {
}
private EntityTransformer provideTileEntityTransformer(Clipboard clipboard) {
//noinspection deprecation
return (x, y, z, id, tag) -> clipboard.setTile(
MathMan.roundInt(x + clipboard.getMinimumPoint().x()),
MathMan.roundInt(y + clipboard.getMinimumPoint().y()),

Datei anzeigen

@ -125,12 +125,14 @@ public class FastSchematicWriterV3 implements ClipboardWriter {
CompoundBinaryTag tag;
if ((tag = block.getNbt()) != null) {
tiles[0]++;
BlockVector3 posNormalized = pos.subtract(clipboard.getMinimumPoint());
try {
tileOut.writeNamedTag("Id", block.getNbtId());
tileOut.writeNamedTag("Pos", new int[]{
posNormalized.x(), posNormalized.y(), posNormalized.z()
pos.x() - clipboard.getMinimumPoint().x(),
pos.y() - clipboard.getMinimumPoint().y(),
pos.z() - clipboard.getMinimumPoint().z()
});
//noinspection deprecation
tileOut.writeNamedTag("Data", new CompoundTag(tag));
tileOut.write(NBTConstants.TYPE_END);
} catch (IOException e) {
@ -189,6 +191,7 @@ public class FastSchematicWriterV3 implements ClipboardWriter {
out.writeDouble(entity.getLocation().z() - clipboard.getMinimumPoint().z());
out.writeLazyCompoundTag("Data", data -> {
//noinspection deprecation
CompoundTag nbt = state.getNbtData();
if (nbt != null) {
nbt.getValue().forEach((s, tag) -> {

Datei anzeigen

@ -296,7 +296,7 @@ public enum BuiltInClipboardFormat implements ClipboardFormat {
return true;
}
},
SPONGE_V3_SCHEMATIC("sponge.3", "slow", "safe") {
SPONGE_V3_SCHEMATIC("sponge.3", "slow", "safe") { // FAWE edit aliases for fast
@Override
public String getPrimaryFileExtension() {
return "schem";