Synchronize access to Bukkit#createBlockData to prevent occasional ConcurrentModification exceptions

- This isn't actually used anymore given the previous commit, however it's still best to keep it safe.
This commit is contained in:
dordsor21 2021-01-14 12:47:02 +00:00
parent 5e1289494e
commit 54712e268a
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
4 changed files with 4 additions and 4 deletions

View File

@ -144,7 +144,7 @@ public final class FAWE_Spigot_v1_15_R2 extends CachedBukkitAdapter implements I
}
@Override
public BlockMaterial getMaterial(BlockState state) {
public synchronized BlockMaterial getMaterial(BlockState state) {
IBlockData bs = ((CraftBlockData) Bukkit.createBlockData(state.getAsString())).getState();
return new BlockMaterial_1_15_2(bs.getBlock(), bs);
}

View File

@ -144,7 +144,7 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
}
@Override
public BlockMaterial getMaterial(BlockState state) {
public synchronized BlockMaterial getMaterial(BlockState state) {
IBlockData bs = ((CraftBlockData) Bukkit.createBlockData(state.getAsString())).getState();
return new BlockMaterial_1_16_1(bs.getBlock(), bs);
}

View File

@ -146,7 +146,7 @@ public final class FAWE_Spigot_v1_16_R2 extends CachedBukkitAdapter implements I
}
@Override
public BlockMaterial getMaterial(BlockState state) {
public synchronized BlockMaterial getMaterial(BlockState state) {
IBlockData bs = ((CraftBlockData) Bukkit.createBlockData(state.getAsString())).getState();
return new BlockMaterial_1_16_2(bs.getBlock(), bs);
}

View File

@ -146,7 +146,7 @@ public final class FAWE_Spigot_v1_16_R3 extends CachedBukkitAdapter implements I
}
@Override
public BlockMaterial getMaterial(BlockState state) {
public synchronized BlockMaterial getMaterial(BlockState state) {
IBlockData bs = ((CraftBlockData) Bukkit.createBlockData(state.getAsString())).getState();
return new BlockMaterial_1_16_4(bs.getBlock(), bs);
}