2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct.blocks;
|
|
|
|
|
|
2014-01-19 19:43:10 +11:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2013-12-31 11:26:08 -05:00
|
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
2013-07-26 21:18:53 -07:00
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
|
|
|
import net.minecraft.entity.item.EntityItem;
|
|
|
|
|
import net.minecraft.util.DamageSource;
|
2013-12-31 11:26:08 -05:00
|
|
|
import net.minecraft.util.IIcon;
|
2013-07-26 21:18:53 -07:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
import net.minecraftforge.fluids.BlockFluidFinite;
|
|
|
|
|
import net.minecraftforge.fluids.Fluid;
|
|
|
|
|
import tconstruct.common.TContent;
|
2013-11-29 23:16:32 -05:00
|
|
|
import tconstruct.common.TRepo;
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.library.TConstructRegistry;
|
|
|
|
|
|
|
|
|
|
public class LiquidMetalFinite extends BlockFluidFinite
|
|
|
|
|
{
|
|
|
|
|
String texture;
|
2014-01-01 08:54:06 -05:00
|
|
|
public IIcon stillIcon;
|
|
|
|
|
public IIcon flowIcon;
|
2013-07-26 21:18:53 -07:00
|
|
|
|
2014-01-29 22:58:29 -05:00
|
|
|
public LiquidMetalFinite(Fluid fluid, String texture)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2014-01-29 22:58:29 -05:00
|
|
|
super(fluid, TRepo.liquidMetal);
|
2013-07-26 21:18:53 -07:00
|
|
|
this.texture = texture;
|
2014-01-15 23:19:27 -05:00
|
|
|
this.func_149647_a(TConstructRegistry.blockTab);
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
2013-11-07 23:13:44 -08:00
|
|
|
|
2013-09-20 00:16:57 -04:00
|
|
|
@Override
|
2014-01-19 19:43:10 +11:00
|
|
|
public int func_149701_w ()
|
2013-11-07 23:13:44 -08:00
|
|
|
{
|
|
|
|
|
return 0;
|
2013-09-20 00:16:57 -04:00
|
|
|
}
|
2013-11-07 23:13:44 -08:00
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
@Override
|
2014-01-18 02:52:49 -05:00
|
|
|
public void func_149651_a (IIconRegister iconRegister)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
|
|
|
|
stillIcon = iconRegister.registerIcon("tinker:" + texture);
|
|
|
|
|
flowIcon = iconRegister.registerIcon("tinker:" + texture + "_flow");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2014-01-19 19:43:10 +11:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
public IIcon func_149691_a (int side, int meta)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
|
|
|
|
if (side == 0 || side == 1)
|
|
|
|
|
return stillIcon;
|
|
|
|
|
return flowIcon;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2014-01-19 19:43:10 +11:00
|
|
|
public void func_149670_a (World par1World, int x, int y, int z, Entity entity)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
|
|
|
|
if (entity instanceof EntityLivingBase)
|
|
|
|
|
{
|
|
|
|
|
entity.motionX *= 0.4D;
|
|
|
|
|
entity.motionZ *= 0.4D;
|
|
|
|
|
}
|
|
|
|
|
if (!(entity instanceof EntityItem) && !entity.isImmuneToFire())
|
|
|
|
|
{
|
|
|
|
|
entity.attackEntityFrom(DamageSource.lava, 4);
|
|
|
|
|
entity.setFire(15);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|