Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-19 17:30:08 +01:00
chore: cleanup
Dieser Commit ist enthalten in:
Ursprung
c039ae8b9b
Commit
510dee4a49
@ -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()),
|
||||
|
@ -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) -> {
|
||||
|
@ -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";
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren