Beispiel #1
0
 protected DiamondLeggingsMat(final int durability) {
   super(
       DIAMOND_LEGGINGS.name(),
       DIAMOND_LEGGINGS.getId(),
       DIAMOND_LEGGINGS.getMinecraftId(),
       Integer.toString(durability),
       (short) durability,
       ArmorMaterial.DIAMOND,
       ArmorType.LEGGINGS);
 }
Beispiel #2
0
 /**
  * Returns one of DiamondLeggings sub-type based on sub-id.
  *
  * @param id sub-type id
  * @return sub-type of DiamondLeggings.
  */
 public static DiamondLeggingsMat getByID(final int id) {
   DiamondLeggingsMat mat = byID.get((short) id);
   if (mat == null) {
     mat = new DiamondLeggingsMat(id);
     if ((id > 0) && (id < DIAMOND_LEGGINGS.getBaseDurability())) {
       DiamondLeggingsMat.register(mat);
     }
   }
   return mat;
 }
Beispiel #3
0
 static {
   DiamondLeggingsMat.register(DIAMOND_LEGGINGS);
 }
Beispiel #4
0
 /**
  * Register new sub-type, may replace existing sub-types. Should be used only if you know what are
  * you doing, it will not create fully usable material.
  *
  * @param element sub-type to register
  */
 public static void register(final DiamondLeggingsMat element) {
   byID.put(element.getType(), element);
   byName.put(element.getTypeName(), element);
 }