EnumToolMaterialStarTreck.java (3010B)
1 package mtrnord.StarTreckMod; 2 3 import net.minecraft.block.Block; 4 import net.minecraft.item.Item; 5 6 public enum EnumToolMaterialStarTreck 7 { 8 WOOD(0, 59, 2.0F, 0.0F, 15), 9 STONE(1, 131, 4.0F, 1.0F, 5), 10 IRON(2, 250, 6.0F, 2.0F, 14), 11 EMERALD(3, 1561, 8.0F, 3.0F, 10), 12 GOLD(0, 32, 12.0F, 0.0F, 22), 13 TITANIUM(5, 6000, 16.0F, 10.0F, 22); 14 15 /** 16 * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) 17 */ 18 private final int harvestLevel; 19 20 /** 21 * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) 22 */ 23 private final int maxUses; 24 25 /** 26 * The strength of this tool material against blocks which it is effective against. 27 */ 28 private final float efficiencyOnProperMaterial; 29 30 /** Damage versus entities. */ 31 private final float damageVsEntity; 32 33 /** Defines the natural enchantability factor of the material. */ 34 private final int enchantability; 35 36 //Added by forge for custom Armor materials. 37 public Item customCraftingMaterial = null; 38 39 private EnumToolMaterialStarTreck(int par3, int par4, float par5, float par6, int par7) 40 { 41 this.harvestLevel = par3; 42 this.maxUses = par4; 43 this.efficiencyOnProperMaterial = par5; 44 this.damageVsEntity = par6; 45 this.enchantability = par7; 46 } 47 48 /** 49 * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) 50 */ 51 public int getMaxUses() 52 { 53 return this.maxUses; 54 } 55 56 /** 57 * The strength of this tool material against blocks which it is effective against. 58 */ 59 public float getEfficiencyOnProperMaterial() 60 { 61 return this.efficiencyOnProperMaterial; 62 } 63 64 /** 65 * Damage versus entities. 66 */ 67 public float getDamageVsEntity() 68 { 69 return this.damageVsEntity; 70 } 71 72 /** 73 * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) 74 */ 75 public int getHarvestLevel() 76 { 77 return this.harvestLevel; 78 } 79 80 /** 81 * Return the natural enchantability factor of the material. 82 */ 83 public int getEnchantability() 84 { 85 return this.enchantability; 86 } 87 88 /** 89 * Return the crafting material for this tool material, used to determine the item that can be used to repair a tool 90 * with an anvil 91 */ 92 public int getToolCraftingMaterial() 93 { 94 95 switch (this) 96 { 97 case WOOD: return Block.planks.blockID; 98 case STONE: return Block.cobblestone.blockID; 99 case GOLD: return Item.ingotGold.itemID; 100 case IRON: return Item.ingotIron.itemID; 101 case EMERALD: return Item.diamond.itemID; 102 case TITANIUM: return StarTreckMod.titaniumIngotID; 103 default: return (customCraftingMaterial == null ? 0 : customCraftingMaterial.itemID); 104 } 105 } 106 }