TheTorchMod/com/bernard/torch/blocks/itemblocs/TorchRechargerItemBlock.java

57 lines
2.1 KiB
Java

/* */ package com.bernard.torch.blocks.itemblocs;
/* */
/* */ import com.bernard.torch.blocks.TorchRechargerBlock;
/* */ import cpw.mods.fml.relauncher.Side;
/* */ import cpw.mods.fml.relauncher.SideOnly;
/* */ import java.util.List;
/* */ import net.minecraft.block.Block;
/* */ import net.minecraft.entity.player.EntityPlayer;
/* */ import net.minecraft.item.ItemBlock;
/* */ import net.minecraft.item.ItemStack;
/* */ import net.minecraft.util.IIcon;
/* */
/* */
/* */
/* */ public class TorchRechargerItemBlock
/* */ extends ItemBlock
/* */ {
/* */ public TorchRechargerItemBlock(Block block)
/* */ {
/* 20 */ super(block);
/* 21 */ setMaxDurability(0);
/* 22 */ setHasSubtypes(true);
/* */ }
/* */
/* */ public void addInformation(ItemStack s, EntityPlayer p, List l, boolean flag)
/* */ {
/* 27 */ super.addInformation(s, p, l, flag);
/* 28 */ if (s.getMetadata() >= TorchRechargerBlock.names.length)
/* 29 */ s.setMetadata(0);
/* 30 */ l.add("Stockage de torches :" + com.bernard.torch.blocks.tileentities.TorchRechargerTileEntity.maxTorchValueFromMeta[s.getMetadata()]);
/* 31 */ l.add("Stockage de charbon :" + com.bernard.torch.blocks.tileentities.TorchRechargerTileEntity.maxCoalValueFromMeta[s.getMetadata()]);
/* 32 */ l.add("Stockage de batons :" + com.bernard.torch.blocks.tileentities.TorchRechargerTileEntity.maxStickValueFromMeta[s.getMetadata()]);
/* */ }
/* */
/* */
/* */ public int getMetadata(int meta)
/* */ {
/* 38 */ return meta;
/* */ }
/* */
/* */ @SideOnly(Side.CLIENT)
/* */ public IIcon getIconFromDamage(int meta)
/* */ {
/* 44 */ return this.blockInstance.getIcon(2, meta);
/* */ }
/* */
/* */ public String getUnlocalizedName(ItemStack stack)
/* */ {
/* 49 */ int meta = stack.getMetadata();
/* 50 */ if ((meta < 0) || (meta >= TorchRechargerBlock.names.length))
/* 51 */ meta = 0;
/* 52 */ return TorchRechargerBlock.names[meta];
/* */ }
/* */ }