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
+ 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
@ -3552,8 +3552,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+ // Paper start - internal get data function, copied from above
+ private CompoundTag getDataInternal(ChunkPos chunkcoordintpair) {
+ Dynamic<Tag> dynamic = this.writeColumn(chunkcoordintpair, NbtOps.INSTANCE);
+ private CompoundTag getDataInternal(ChunkPos pos) {
+ RegistryOps<Tag> registryOps = RegistryOps.create(NbtOps.INSTANCE, this.registryAccess);
+ Dynamic<Tag> dynamic = this.writeColumn(pos, registryOps);
+ Tag nbtbase = (Tag) dynamic.getValue();
+
+ if (nbtbase instanceof CompoundTag) {