2013-11-09 14:28:48 -08:00
|
|
|
package tconstruct.blocks;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.block.material.Material;
|
2013-12-31 11:26:08 -05:00
|
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
2013-11-09 14:28:48 -08:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2013-12-31 11:26:08 -05:00
|
|
|
import net.minecraft.util.IIcon;
|
2013-11-09 14:28:48 -08:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
import tconstruct.TConstruct;
|
|
|
|
|
import tconstruct.blocks.logic.FurnaceLogic;
|
|
|
|
|
import tconstruct.common.TProxyCommon;
|
|
|
|
|
import tconstruct.library.TConstructRegistry;
|
2013-12-01 12:19:43 +00:00
|
|
|
import mantle.blocks.abstracts.InventorySlab;
|
2013-12-01 19:46:08 -05:00
|
|
|
import mantle.blocks.iface.IActiveLogic;
|
2013-12-01 21:55:04 +00:00
|
|
|
import mantle.blocks.iface.IFacingLogic;
|
2013-11-09 14:28:48 -08:00
|
|
|
|
|
|
|
|
public class FurnaceSlab extends InventorySlab
|
|
|
|
|
{
|
|
|
|
|
|
2013-12-31 11:26:08 -05:00
|
|
|
public FurnaceSlab(Material material)
|
2013-11-09 14:28:48 -08:00
|
|
|
{
|
2013-12-31 11:26:08 -05:00
|
|
|
super(material);
|
2014-01-15 00:34:19 -05:00
|
|
|
this.func_149647_a(TConstructRegistry.blockTab);
|
2014-01-15 23:19:27 -05:00
|
|
|
this.func_149711_c(3.5f);
|
2013-11-09 14:28:48 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2014-01-15 23:19:27 -05:00
|
|
|
public TileEntity createTileEntity (World world, int metadata)
|
2013-11-09 14:28:48 -08:00
|
|
|
{
|
|
|
|
|
switch (metadata % 8)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
return new FurnaceLogic();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
|
|
|
|
{
|
|
|
|
|
return TProxyCommon.furnaceID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Object getModInstance ()
|
|
|
|
|
{
|
|
|
|
|
return TConstruct.instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String[] getTextureNames ()
|
|
|
|
|
{
|
|
|
|
|
String[] textureNames = { "furnaceslab_front", "furnaceslab_front_active", "furnaceslab_side", "furnace_top" };
|
|
|
|
|
|
|
|
|
|
return textureNames;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2014-02-01 15:43:24 -05:00
|
|
|
public IIcon func_149691_a (int side, int meta)
|
2013-11-09 14:28:48 -08:00
|
|
|
{
|
|
|
|
|
return icons[(meta % 8) * 3 + getTextureIndex(side)];
|
|
|
|
|
}
|
|
|
|
|
|
2013-12-31 15:30:34 -05:00
|
|
|
public IIcon getBlockTexture (IBlockAccess world, int x, int y, int z, int side)
|
2013-11-09 14:28:48 -08:00
|
|
|
{
|
2014-02-01 15:43:24 -05:00
|
|
|
TileEntity logic = world.func_147438_o(x, y, z);
|
2013-11-09 14:28:48 -08:00
|
|
|
short direction = (logic instanceof IFacingLogic) ? ((IFacingLogic) logic).getRenderDirection() : 0;
|
|
|
|
|
int meta = world.getBlockMetadata(x, y, z) % 8;
|
|
|
|
|
|
|
|
|
|
if (meta == 0)
|
|
|
|
|
{
|
|
|
|
|
if (side == direction)
|
|
|
|
|
{
|
|
|
|
|
if (((IActiveLogic) logic).getActive())
|
|
|
|
|
return icons[1];
|
|
|
|
|
else
|
|
|
|
|
return icons[0];
|
|
|
|
|
}
|
|
|
|
|
else if (side > 1)
|
|
|
|
|
{
|
|
|
|
|
return icons[2];
|
|
|
|
|
}
|
|
|
|
|
return icons[3];
|
|
|
|
|
}
|
|
|
|
|
return icons[0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getTextureIndex (int side)
|
|
|
|
|
{
|
|
|
|
|
if (side == 0 || side == 1)
|
|
|
|
|
return 3;
|
|
|
|
|
if (side == 3)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2014-01-18 02:52:49 -05:00
|
|
|
public void func_149651_a (IIconRegister iconRegister)
|
2013-11-09 14:28:48 -08:00
|
|
|
{
|
|
|
|
|
String[] textureNames = getTextureNames();
|
2013-12-31 15:30:34 -05:00
|
|
|
this.icons = new IIcon[textureNames.length];
|
2013-11-09 14:28:48 -08:00
|
|
|
|
|
|
|
|
for (int i = 0; i < this.icons.length; ++i)
|
|
|
|
|
{
|
|
|
|
|
if (i == 3)
|
|
|
|
|
this.icons[i] = iconRegister.registerIcon("minecraft:" + textureNames[i]);
|
|
|
|
|
else
|
|
|
|
|
this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-01-15 23:19:27 -05:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public TileEntity func_149915_a (World var1, int metadata)
|
|
|
|
|
{
|
|
|
|
|
switch (metadata % 8)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
return new FurnaceLogic();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2013-11-09 14:28:48 -08:00
|
|
|
}
|