/
NetherGlassItem.java
56 lines (48 loc) · 1.38 KB
/
NetherGlassItem.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
package mods.natura.items.blocks;
import java.util.List;
import mods.natura.common.NContent;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class NetherGlassItem extends ItemBlock
{
public static final String blockType[] = { "soul", "heat" };
public NetherGlassItem(int i)
{
super(i);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public int getMetadata (int meta)
{
return meta;
}
public String getUnlocalizedName (ItemStack itemstack)
{
return (new StringBuilder()).append("tile.glass.").append(blockType[itemstack.getItemDamage()]).toString();
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage (int meta)
{
if (meta < 1)
return NContent.netherGlass.icons[2];
return NContent.netherGlass.icons[3];
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
switch (stack.getItemDamage())
{
case 0:
list.add(StatCollector.translateToLocal("tooltip.glass.soul"));
break;
}
}
}