mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix potential threading issue if FluidRegistry.loopupFluidForBlock is called from two threads at the same time before being setup. Closes #936
This commit is contained in:
1 parent
14b9d639a2
commit
12e8d95e9f
1 file changed
+3
-2
@@ -148,14 +148,15 @@ public abstract class FluidRegistry
|
||||
{
|
||||
if (fluidBlocks == null)
|
||||
{
|
||||
fluidBlocks = HashBiMap.create();
|
||||
BiMap<Block, Fluid> tmp = HashBiMap.create();
|
||||
for (Fluid fluid : fluids.values())
|
||||
{
|
||||
if (fluid.canBePlacedInWorld() && fluid.getBlock() != null)
|
||||
{
|
||||
fluidBlocks.put(fluid.getBlock(), fluid);
|
||||
tmp.put(fluid.getBlock(), fluid);
|
||||
}
|
||||
}
|
||||
fluidBlocks = tmp;
|
||||
}
|
||||
return fluidBlocks.get(block);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user