diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java')
-rw-r--r-- | src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java index 24ebf0ecca..2aa598fc96 100644 --- a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java +++ b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java @@ -2,26 +2,30 @@ package gtPlusPlus.core.fluids; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; public class BlockFluidBase extends BlockFluidClassic { @SideOnly(Side.CLIENT) - protected IIcon stillIcon; + protected static IIcon stillIcon; @SideOnly(Side.CLIENT) - protected IIcon flowingIcon; + protected static IIcon flowingIcon; + + protected final short[] mRGB; - public BlockFluidBase(Fluid fluid, Material material) { + public BlockFluidBase(Fluid fluid, Material material, short[] aRGB) { super(fluid, material); + mRGB = aRGB; } @Override @@ -29,9 +33,9 @@ public class BlockFluidBase extends BlockFluidClassic { if (!(ent instanceof EntityLivingBase)) { return; } - EntityLivingBase player = (EntityLivingBase) ent; + /*EntityLivingBase player = (EntityLivingBase) ent; int pot = world.rand.nextInt(Potion.potionTypes.length); - Potion.potionTypes[pot].performEffect(player, 40); + Potion.potionTypes[pot].performEffect(player, 40);*/ } @Override @@ -42,24 +46,34 @@ public class BlockFluidBase extends BlockFluidClassic { @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister register) { - stillIcon = register.registerIcon("chaotica:pureChaosStill"); - flowingIcon = register.registerIcon("chaotica:pureChaosFlowing"); + if (stillIcon == null) { + stillIcon = register.registerIcon(CORE.MODID+ ":" + "fluids/fluid.fluid.autogenerated.still"); + } + if (flowingIcon == null) { + flowingIcon = register.registerIcon(CORE.MODID+ ":" + "fluids/fluid.fluid.autogenerated.flowing"); + } } @Override - public boolean canDisplace(IBlockAccess world, int x, int y, int z) { - if (world.getBlock(x, y, z).getMaterial().isLiquid()) { - return false; - } - return super.canDisplace(world, x, y, z); + public int getBlockColor() { + if (mRGB != null && mRGB.length >= 3) { + return Utils.rgbtoHexValue(mRGB[0], mRGB[1], mRGB[2]); + } + return super.getBlockColor(); } @Override - public boolean displaceIfPossible(World world, int x, int y, int z) { - if (world.getBlock(x, y, z).getMaterial().isLiquid()) { - return false; - } - return super.displaceIfPossible(world, x, y, z); + public int getRenderColor(int aMeta) { + if (mRGB != null && mRGB.length >= 3) { + return Utils.rgbtoHexValue(mRGB[0], mRGB[1], mRGB[2]); + } + return super.getRenderColor(aMeta); + } + + @Override + public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) { + // TODO Auto-generated method stub + return super.recolourBlock(world, x, y, z, side, colour); } } |