Added block Fluid from FM
block fluid prefab that is now used by the registry system to create new fluid based blocks
This commit is contained in:
parent
8a85d97ae8
commit
fda3a1de12
1 changed files with 47 additions and 0 deletions
47
src/dark/core/registration/BlockFluid.java
Normal file
47
src/dark/core/registration/BlockFluid.java
Normal file
|
@ -0,0 +1,47 @@
|
|||
package dark.core.registration;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.fluids.BlockFluidFinite;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import dark.core.common.DarkMain;
|
||||
|
||||
public class BlockFluid extends BlockFluidFinite
|
||||
{
|
||||
Icon flowing;
|
||||
Icon still;
|
||||
Fluid fluid;
|
||||
String prefix = DarkMain.getInstance().PREFIX;
|
||||
|
||||
public BlockFluid(String prefix, Fluid fluid, Configuration config)
|
||||
{
|
||||
super(config.getBlock(fluid.getName(), DarkMain.getNextID()).getInt(), fluid, Material.water);
|
||||
this.fluid = fluid;
|
||||
if (prefix != null && prefix.contains(":"))
|
||||
{
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.flowing = par1IconRegister.registerIcon(prefix + this.getUnlocalizedName().replace("tile.", "") + "_flowing");
|
||||
this.still = par1IconRegister.registerIcon(prefix + this.getUnlocalizedName().replace("tile.", "") + "_still");
|
||||
fluid.setIcons(still, flowing);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon(int par1, int par2)
|
||||
{
|
||||
return still;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue