mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-22 07:43:49 -07:00
Defensively copy chunk data in upgradeChunkTag
The data provided is always from the regionfile thread, which does not copy the data out. So if two separate calls need the data, then there's going to be a problem.
This commit is contained in:
@@ -3219,6 +3219,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
CompoundTag level = nbt.getCompound("Level");
|
||||
if (level.getBoolean("TerrainPopulated")) {
|
||||
@@ -0,0 +0,0 @@ public class ChunkStorage implements AutoCloseable {
|
||||
|
||||
public CompoundTag upgradeChunkTag(ResourceKey<LevelStem> resourcekey, Supplier<DimensionDataStorage> supplier, CompoundTag nbttagcompound, Optional<ResourceKey<Codec<? extends ChunkGenerator>>> optional, ChunkPos pos, @Nullable LevelAccessor generatoraccess) throws IOException {
|
||||
// CraftBukkit end
|
||||
+ nbttagcompound = nbttagcompound.copy(); // Paper - defensive copy, another thread might modify this
|
||||
int i = ChunkStorage.getVersion(nbttagcompound);
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -0,0 +0,0 @@ public class ChunkStorage implements AutoCloseable {
|
||||
if (i < 1493) {
|
||||
nbttagcompound = NbtUtils.update(this.fixerUpper, DataFixTypes.CHUNK, nbttagcompound, i, 1493);
|
||||
if (nbttagcompound.getCompound("Level").getBoolean("hasLegacyStructureData")) {
|
||||
|
Reference in New Issue
Block a user