-
Notifications
You must be signed in to change notification settings - Fork 754
/
CraftingStationBlock.java
109 lines (92 loc) · 2.57 KB
/
CraftingStationBlock.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package tconstruct.blocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
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;
import mantle.blocks.abstracts.InventoryBlock;
public class CraftingStationBlock extends InventoryBlock
{
public CraftingStationBlock(Material material)
{
super(material);
this.setCreativeTab(TConstructRegistry.blockTab);
this.setHardness(2f);
this.stepSound = Block.soundTypeWood;
}
//Block.hasComparatorInputOverride and Block.getComparatorInputOverride
/* Rendering */
@Override
public String[] getTextureNames ()
{
String[] textureNames = { "craftingstation_top", "craftingstation_side", "craftingstation_bottom" };
return textureNames;
}
@Override
public IIcon getIcon (int side, int meta)
{
return icons[meta * 3 + getTextureIndex(side)];
}
public int getTextureIndex (int side)
{
if (side == 0)
return 2;
if (side == 1)
return 0;
return 1;
}
@Override
public boolean renderAsNormalBlock ()
{
return false;
}
@Override
public boolean isOpaqueCube ()
{
return false;
}
@Override
public int getRenderType ()
{
return TableRender.tabelModelID;
}
@Override
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
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
public void getSubBlocks (Item id, CreativeTabs tab, List list)
{
for (int iter = 0; iter < 1; iter++)
{
list.add(new ItemStack(id, 1, iter));
}
}
@Override
public TileEntity createNewTileEntity (World arg0, int arg1)
{
return new CraftingStationLogic();
}
}