2013-10-29 20:52:51 +00:00
|
|
|
package biomesoplenty.itemblocks;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.item.ItemBlock;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
|
|
public class ItemBlockHive extends ItemBlock
|
|
|
|
{
|
2013-10-30 18:56:32 +00:00
|
|
|
private static final String[] types = new String[] {"honeycomb", "hive", "honeycombempty"};
|
2013-10-29 20:52:51 +00:00
|
|
|
|
|
|
|
public ItemBlockHive(int par1)
|
|
|
|
{
|
|
|
|
super(par1);
|
|
|
|
setMaxDamage(0);
|
|
|
|
setHasSubtypes(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getMetadata(int meta)
|
|
|
|
{
|
|
|
|
return meta & 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getUnlocalizedName(ItemStack itemstack) {
|
|
|
|
int meta = itemstack.getItemDamage();
|
|
|
|
if (meta < 0 || meta >= types.length) {
|
|
|
|
meta = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return super.getUnlocalizedName() + "." + types[meta];
|
|
|
|
}
|
|
|
|
}
|