Skip to content

Commit

Permalink
Fix fluid icons when default changes the used liquid
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Apr 20, 2015
1 parent c098192 commit 017a7f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/tconstruct/smeltery/TinkerSmeltery.java
Expand Up @@ -1026,6 +1026,9 @@ public static Fluid registerFluid(String name, String fluidName, String blockNam
block.setBlockName(blockName);
GameRegistry.registerBlock(block, blockName);

fluid.setBlock(block);
block.setFluid(fluid);

// if the fluid was already registered we use that one instead
if (isFluidPreRegistered)
{
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/tconstruct/smeltery/blocks/TConstructFluid.java
Expand Up @@ -14,6 +14,7 @@ public class TConstructFluid extends BlockFluidClassic
public IIcon stillIcon;
public IIcon flowIcon;
boolean overwriteFluidIcons = true;
private Fluid fluid = null;

public TConstructFluid(Fluid fluid, Material material, String texture)
{
Expand Down Expand Up @@ -42,6 +43,9 @@ public void registerBlockIcons (IIconRegister iconRegister)

if (overwriteFluidIcons)
this.getFluid().setIcons(stillIcon, flowIcon);

if(this.getFluid().getBlock() != this && fluid != null)
fluid.setIcons(stillIcon, flowIcon);
}

@Override
Expand All @@ -58,4 +62,7 @@ public void suppressOverwritingFluidIcons ()
overwriteFluidIcons = false;
}

public void setFluid(Fluid fluid) {
this.fluid = fluid;
}
}

0 comments on commit 017a7f7

Please sign in to comment.