Wrap NBTOps in RegistryOps (#7892)

This commit is contained in:
Owen1212055
2022-06-08 14:25:39 -04:00
parent 2b1b40b4f5
commit f136fe47a3

View File

@@ -3532,7 +3532,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ // Paper start - async chunk io + // Paper start - async chunk io
+ public void loadInData(ChunkPos chunkPos, CompoundTag compound) { + public void loadInData(ChunkPos chunkPos, CompoundTag compound) {
+ this.readColumn(chunkPos, NbtOps.INSTANCE, compound); + this.readColumn(chunkPos, RegistryOps.create(NbtOps.INSTANCE, this.registryAccess), compound);
} }
+ // Paper end - aync chnnk i + // Paper end - aync chnnk i
@@ -3552,8 +3552,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
+ // Paper start - internal get data function, copied from above + // Paper start - internal get data function, copied from above
+ private CompoundTag getDataInternal(ChunkPos chunkcoordintpair) { + private CompoundTag getDataInternal(ChunkPos pos) {
+ Dynamic<Tag> dynamic = this.writeColumn(chunkcoordintpair, NbtOps.INSTANCE); + RegistryOps<Tag> registryOps = RegistryOps.create(NbtOps.INSTANCE, this.registryAccess);
+ Dynamic<Tag> dynamic = this.writeColumn(pos, registryOps);
+ Tag nbtbase = (Tag) dynamic.getValue(); + Tag nbtbase = (Tag) dynamic.getValue();
+ +
+ if (nbtbase instanceof CompoundTag) { + if (nbtbase instanceof CompoundTag) {