mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01: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:
parent
4c43d2f2b9
commit
2ecc06a8fb
1 changed files with 8 additions and 0 deletions
|
@ -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")) {
|
||||
|
|
Loading…
Reference in a new issue