Finish moving patches back and improving compilable state

This commit is contained in:
Nassim Jahnke
2024-01-25 10:54:46 +01:00
parent 52438f04a0
commit d71804b7f8
17 changed files with 124 additions and 69 deletions

View File

@@ -28,8 +28,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Preconditions.checkArgument(data.length > 0, "cannot deserialize nothing");
+
+ CompoundTag compound = deserializeNbtFromBytes(data);
+ int dataVersion = compound.getInt("DataVersion");
+ return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ITEM_STACK, compound, dataVersion, getDataVersion())));
+ final int dataVersion = compound.getInt("DataVersion");
+ compound = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ITEM_STACK, new Dynamic<>(NbtOps.INSTANCE, compound), dataVersion, this.getDataVersion()).getValue();
+ return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(compound));
+ }
+
+ private byte[] serializeNbtToBytes(CompoundTag compound) {