drackiseries

Custom Tool Materials

Jul 10th, 2012
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.66 KB | None | 0 0
  1. TOOL DECELERATIONS IN MOD_ FILE:
  2.  
  3. public static final Item LSPickaxe = (new ItemPickaxe(1003,EnumToolMaterial.LAVASTONE).setItemName("LSPickaxe"));
  4.     public static final Item LSSword = (new ItemSword(1004,EnumToolMaterial.LAVASTONE).setItemName("LSSword"));
  5.     public static final Item LSSpade = (new ItemSpade(1005,EnumToolMaterial.LAVASTONE).setItemName("LSSpade"));
  6.     public static final Item LSAxe = (new ItemAxe(1006,EnumToolMaterial.LAVASTONE).setItemName("LSAxe"));
  7.     public static final Item LSHoe = (new ItemHoe(1007,EnumToolMaterial.LAVASTONE).setItemName("LSHoe"));
  8.  
  9. ENUMTOOLMATERIAL FILE:
  10.  
  11.  
  12. package net.minecraft.src;
  13.  
  14. public enum EnumToolMaterial
  15. {
  16.     WOOD(0, 59, 2.0F, 0, 15),
  17.     STONE(1, 131, 4F, 1, 5),
  18.     IRON(2, 250, 6F, 2, 14),
  19.     EMERALD(3, 1561, 8F, 3, 10),
  20.     GOLD(0, 32, 12F, 0, 22),
  21.    
  22.     LAVASTONE(4,700,12F,2,15);
  23.    
  24.     /**
  25.      * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
  26.      */
  27.     private final int harvestLevel;
  28.  
  29.     /**
  30.      * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
  31.      */
  32.     private final int maxUses;
  33.  
  34.     /**
  35.      * The strength of this tool material against blocks which it is effective against.
  36.      */
  37.     private final float efficiencyOnProperMaterial;
  38.  
  39.     /** Damage versus entities. */
  40.     private final int damageVsEntity;
  41.  
  42.     /** Defines the natural enchantability factor of the material. */
  43.     private final int enchantability;
  44.  
  45.     private EnumToolMaterial(int par3, int par4, float par5, int par6, int par7)
  46.     {
  47.         harvestLevel = par3;
  48.         maxUses = par4;
  49.         efficiencyOnProperMaterial = par5;
  50.         damageVsEntity = par6;
  51.         enchantability = par7;
  52.     }
  53.  
  54.     /**
  55.      * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
  56.      */
  57.     public int getMaxUses()
  58.     {
  59.         return maxUses;
  60.     }
  61.  
  62.     /**
  63.      * The strength of this tool material against blocks which it is effective against.
  64.      */
  65.     public float getEfficiencyOnProperMaterial()
  66.     {
  67.         return efficiencyOnProperMaterial;
  68.     }
  69.  
  70.     /**
  71.      * Damage versus entities.
  72.      */
  73.     public int getDamageVsEntity()
  74.     {
  75.         return damageVsEntity;
  76.     }
  77.  
  78.     /**
  79.      * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
  80.      */
  81.     public int getHarvestLevel()
  82.     {
  83.         return harvestLevel;
  84.     }
  85.  
  86.     /**
  87.      * Return the natural enchantability factor of the material.
  88.      */
  89.     public int getEnchantability()
  90.     {
  91.         return enchantability;
  92.     }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment