Prevent NPE in fluid lookup for block

This commit is contained in:
viliml 2013-09-14 20:16:46 +02:00
parent a066018c9f
commit ac58bb2f5a

View file

@ -1,4 +1,3 @@
package net.minecraftforge.fluids; package net.minecraftforge.fluids;
import java.util.HashMap; import java.util.HashMap;
@ -133,6 +132,7 @@ public abstract class FluidRegistry
{ {
if (fluidBlocks == null) if (fluidBlocks == null)
{ {
fluidBlocks = new BiMap<Block, Fluid>();
for (Fluid fluid : fluids.values()) for (Fluid fluid : fluids.values())
{ {
if (fluid.canBePlacedInWorld() && Block.blocksList[fluid.getBlockID()] != null) if (fluid.canBePlacedInWorld() && Block.blocksList[fluid.getBlockID()] != null)