Add DataConverter to StructureCheck, for structure lookups

Mojang added a partial conversion here to quickly check for
structures, which bypasses the chunk system. So we need a
hook here.
This commit is contained in:
Spottedleaf
2022-02-25 08:46:35 -08:00
parent b34f1fbdae
commit 568435b5fa
2 changed files with 55 additions and 0 deletions

View File

@@ -21672,6 +21672,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
OptionalDynamic<T> optionalDynamic = dynamic2.get("Sections");
for(int l = this.levelHeightAccessor.getMinSection(); l < this.levelHeightAccessor.getMaxSection(); ++l) {
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
@@ -0,0 +0,0 @@ public class StructureCheck {
CompoundTag compoundTag2;
try {
- compoundTag2 = NbtUtils.update(this.fixerUpper, DataFixTypes.CHUNK, compoundTag, i);
+ compoundTag2 = ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.CHUNK, compoundTag, i, net.minecraft.SharedConstants.getCurrentVersion().getWorldVersion()); // Paper - replace chunk converter
} catch (Exception var12) {
LOGGER.warn("Failed to partially datafix chunk {}", pos, var12);
return StructureCheckResult.CHUNK_LOAD_NEEDED;
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java