Files
TinkersConstruct/src/main/java/tconstruct/blocks/CraftingStationBlock.java
T

109 lines
2.6 KiB
Java
Raw Normal View History

2013-08-07 19:06:26 -07:00
package tconstruct.blocks;
import java.util.List;
2014-02-05 10:28:54 -05:00
import mantle.blocks.abstracts.InventoryBlock;
2013-08-07 19:06:26 -07:00
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
2014-02-01 14:18:17 -05:00
import net.minecraft.item.Item;
2013-08-07 19:06:26 -07:00
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
2013-12-31 15:30:34 -05:00
import net.minecraft.util.IIcon;
2013-08-07 19:06:26 -07:00
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import tconstruct.TConstruct;
import tconstruct.blocks.logic.CraftingStationLogic;
import tconstruct.client.block.TableRender;
import tconstruct.common.TProxyCommon;
import tconstruct.library.TConstructRegistry;
public class CraftingStationBlock extends InventoryBlock
{
2014-01-09 04:08:38 -05:00
public CraftingStationBlock(Material material)
2013-08-07 19:06:26 -07:00
{
2013-12-31 15:30:34 -05:00
super(material);
2014-02-05 08:28:53 -05:00
this.setCreativeTab(TConstructRegistry.blockTab);
this.setHardness(2f);
this.stepSound = Block.soundTypeWood;
2013-08-07 19:06:26 -07:00
}
//Block.hasComparatorInputOverride and Block.getComparatorInputOverride
/* Rendering */
@Override
public String[] getTextureNames ()
{
2013-08-31 05:13:31 -07:00
String[] textureNames = { "craftingstation_top", "craftingstation_side", "craftingstation_bottom" };
2013-08-07 19:06:26 -07:00
return textureNames;
}
@Override
2014-02-05 08:28:53 -05:00
public IIcon getIcon (int side, int meta)
2013-08-07 19:06:26 -07:00
{
return icons[meta * 3 + getTextureIndex(side)];
}
public int getTextureIndex (int side)
{
if (side == 0)
return 2;
if (side == 1)
return 0;
return 1;
}
@Override
2014-02-05 08:28:53 -05:00
public boolean renderAsNormalBlock ()
2013-08-07 19:06:26 -07:00
{
return false;
}
@Override
2014-02-05 08:28:53 -05:00
public boolean isOpaqueCube ()
2013-08-07 19:06:26 -07:00
{
return false;
}
@Override
2014-02-05 08:28:53 -05:00
public int getRenderType ()
2013-08-07 19:06:26 -07:00
{
return TableRender.tabelModelID;
}
@Override
2014-02-05 08:28:53 -05:00
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
2013-08-07 19:06:26 -07:00
{
return true;
}
@Override
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
{
return TProxyCommon.craftingStationID;
}
@Override
public Object getModInstance ()
{
return TConstruct.instance;
}
@Override
2014-02-05 08:28:53 -05:00
public void getSubBlocks (Item id, CreativeTabs tab, List list)
2013-08-07 19:06:26 -07:00
{
for (int iter = 0; iter < 1; iter++)
{
list.add(new ItemStack(id, 1, iter));
2013-08-07 19:06:26 -07:00
}
}
2014-02-01 14:18:17 -05:00
2014-02-05 09:11:06 -05:00
@Override
public TileEntity createNewTileEntity (World arg0, int arg1)
{
return new CraftingStationLogic();
}
2013-08-07 19:06:26 -07:00
}