001    package net.minecraft.src;
002    
003    public enum EnumToolMaterial
004    {
005        WOOD(0, 59, 2.0F, 0, 15),
006        STONE(1, 131, 4.0F, 1, 5),
007        IRON(2, 250, 6.0F, 2, 14),
008        EMERALD(3, 1561, 8.0F, 3, 10),
009        GOLD(0, 32, 12.0F, 0, 22);
010    
011        /**
012         * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
013         */
014        private final int harvestLevel;
015    
016        /**
017         * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
018         */
019        private final int maxUses;
020    
021        /**
022         * The strength of this tool material against blocks which it is effective against.
023         */
024        private final float efficiencyOnProperMaterial;
025    
026        /** Damage versus entities. */
027        private final int damageVsEntity;
028    
029        /** Defines the natural enchantability factor of the material. */
030        private final int enchantability;
031    
032        private EnumToolMaterial(int par3, int par4, float par5, int par6, int par7)
033        {
034            this.harvestLevel = par3;
035            this.maxUses = par4;
036            this.efficiencyOnProperMaterial = par5;
037            this.damageVsEntity = par6;
038            this.enchantability = par7;
039        }
040    
041        /**
042         * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
043         */
044        public int getMaxUses()
045        {
046            return this.maxUses;
047        }
048    
049        /**
050         * The strength of this tool material against blocks which it is effective against.
051         */
052        public float getEfficiencyOnProperMaterial()
053        {
054            return this.efficiencyOnProperMaterial;
055        }
056    
057        /**
058         * Damage versus entities.
059         */
060        public int getDamageVsEntity()
061        {
062            return this.damageVsEntity;
063        }
064    
065        /**
066         * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
067         */
068        public int getHarvestLevel()
069        {
070            return this.harvestLevel;
071        }
072    
073        /**
074         * Return the natural enchantability factor of the material.
075         */
076        public int getEnchantability()
077        {
078            return this.enchantability;
079        }
080    
081        /**
082         * Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
083         * with an anvil
084         */
085        public int getToolCraftingMaterial()
086        {
087            return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
088        }
089    }