Update DataConverter

This commit is contained in:
Nassim Jahnke
2023-03-15 20:17:42 +01:00
parent d166b09352
commit 8ff5a4a679
4 changed files with 64 additions and 42 deletions

View File

@@ -5267,7 +5267,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ final CompoundTag sections = new CompoundTag();
+ ret.put("Sections", sections);
+
+ ret.putInt("DataVersion", SharedConstants.getCurrentVersion().getWorldVersion());
+ ret.putInt("DataVersion", SharedConstants.getCurrentVersion().getDataVersion().getVersion());
+
+ final ServerLevel world = this.world;
+ final PoiManager poiManager = world.getPoiManager();
@@ -7306,7 +7306,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // run converters
+ final int dataVersion = !data.contains(SharedConstants.DATA_VERSION_TAG, 99) ? 1945 : data.getInt(SharedConstants.DATA_VERSION_TAG);
+ final CompoundTag converted = MCDataConverter.convertTag(
+ MCTypeRegistry.POI_CHUNK, data, dataVersion, SharedConstants.getCurrentVersion().getWorldVersion()
+ MCTypeRegistry.POI_CHUNK, data, dataVersion, SharedConstants.getCurrentVersion().getDataVersion().getVersion()
+ );
+
+ // now we need to parse it
@@ -17341,7 +17341,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- private CompoundTag upgradeChunkTag(CompoundTag chunkNbt) {
+ public static CompoundTag upgradeChunkTag(CompoundTag chunkNbt) { // Paper - public and static
int i = NbtUtils.getDataVersion(chunkNbt, -1);
return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY_CHUNK, chunkNbt, i, net.minecraft.SharedConstants.getCurrentVersion().getWorldVersion()); // Paper - route to new converter system
return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY_CHUNK, chunkNbt, i, net.minecraft.SharedConstants.getCurrentVersion().getDataVersion().getVersion()); // Paper - route to new converter system
}
@Override