-
Notifications
You must be signed in to change notification settings - Fork 755
/
SoilSlabItem.java
48 lines (41 loc) · 1.27 KB
/
SoilSlabItem.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
package tconstruct.items.blocks;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class SoilSlabItem extends ItemBlock
{
public static final String blockType[] = { "grass", "dirt", "mycelium", "slime", "grout", "blueslime", "graveyardsoil", "consecratedsoil" };
public SoilSlabItem(int id)
{
super(id);
setMaxDamage(0);
setHasSubtypes(true);
}
public int getMetadata (int meta)
{
return meta;
}
public String getUnlocalizedName (ItemStack itemstack)
{
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1);
return (new StringBuilder()).append("block.soil.slab.").append(blockType[pos]).toString();
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
switch (stack.getItemDamage())
{
case 3:
list.add("Heals Undead");
break;
case 4:
list.add("Harmful to Undead");
break;
}
}
}