Expose the fluid that a block was constructed with, useful for 'non-default'

configuration of fluidblocks. Shouldn't be used outside of this purpose.
This commit is contained in:
cpw 2015-04-20 10:29:04 -04:00
parent 50608986fe
commit 96cbadb874

View file

@ -50,6 +50,13 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
protected final String fluidName; protected final String fluidName;
/**
* This is the fluid used in the constructor. Use this reference to configure things
* like icons for your block. It might not be active in the registry, so do
* NOT expose it.
*/
protected final Fluid definedFluid;
public BlockFluidBase(Fluid fluid, Material material) public BlockFluidBase(Fluid fluid, Material material)
{ {
super(material); super(material);
@ -65,6 +72,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
this.densityDir = fluid.density > 0 ? -1 : 1; this.densityDir = fluid.density > 0 ? -1 : 1;
fluid.setBlock(this); fluid.setBlock(this);
this.definedFluid = fluid;
displacements.putAll(defaultDisplacements); displacements.putAll(defaultDisplacements);
} }