Regress to upstream for (Binary)Tags in data fixers

This commit is contained in:
dordsor21
2021-10-19 14:12:02 +01:00
parent b5479e480d
commit 37eb4a1008
5 changed files with 17 additions and 47 deletions

View File

@ -20,7 +20,6 @@
package com.sk89q.worldedit.extent.clipboard.io;
import com.google.common.collect.ImmutableList;
import com.sk89q.jnbt.AdventureNBTConverter;
import com.sk89q.jnbt.ByteArrayTag;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.IntTag;
@ -229,13 +228,7 @@ public class MCEditSchematicReader extends NBTSchematicReader {
}
if (fixer != null && t != null) {
//FAWE start
t = (CompoundTag) AdventureNBTConverter.fromAdventure(fixer.fixUp(
DataFixer.FixTypes.BLOCK_ENTITY,
t.asBinaryTag(),
-1
));
//FAWE end
t = fixer.fixUp(DataFixer.FixTypes.BLOCK_ENTITY, t, -1);
}
BlockVector3 vec = BlockVector3.at(x, y, z);
@ -296,11 +289,7 @@ public class MCEditSchematicReader extends NBTSchematicReader {
if (tag instanceof CompoundTag) {
CompoundTag compound = (CompoundTag) tag;
if (fixer != null) {
compound = (CompoundTag) AdventureNBTConverter.fromAdventure(fixer.fixUp(
DataFixer.FixTypes.ENTITY,
compound.asBinaryTag(),
-1
));
compound = fixer.fixUp(DataFixer.FixTypes.ENTITY, compound, -1);
}
String id = convertEntityId(compound.getString("id"));
Location location = NBTConversions.toLocation(

View File

@ -20,7 +20,6 @@
package com.sk89q.worldedit.extent.clipboard.io;
import com.google.common.collect.Maps;
import com.sk89q.jnbt.AdventureNBTConverter;
import com.sk89q.jnbt.ByteArrayTag;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.IntArrayTag;
@ -271,11 +270,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
values.remove("Id");
values.remove("Pos");
if (fixer != null) {
//FAWE start
tileEntity = ((CompoundTag) AdventureNBTConverter.fromAdventure(fixer.fixUp(DataFixer.FixTypes.BLOCK_ENTITY,
new CompoundTag(values).asBinaryTag(), dataVersion
))).getValue();
//FAWE end
tileEntity = fixer.fixUp(DataFixer.FixTypes.BLOCK_ENTITY, new CompoundTag(values), dataVersion).getValue();
} else {
tileEntity = values;
}
@ -416,13 +411,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
entityTag = entityTag.createBuilder().putString("id", id).remove("Id").build();
if (fixer != null) {
//FAWE start
entityTag = (CompoundTag) AdventureNBTConverter.fromAdventure(fixer.fixUp(
DataFixer.FixTypes.ENTITY,
entityTag.asBinaryTag(),
dataVersion
));
//FAWE end
entityTag = fixer.fixUp(DataFixer.FixTypes.ENTITY, entityTag, dataVersion);
}
EntityType entityType = EntityTypes.get(id);