Пример #1
0
 protected IronChestplateMat(final int durability) {
   super(
       IRON_CHESTPLATE.name(),
       IRON_CHESTPLATE.getId(),
       IRON_CHESTPLATE.getMinecraftId(),
       Integer.toString(durability),
       (short) durability,
       ArmorMaterial.IRON);
 }
Пример #2
0
 /**
  * Returns one of IronChestplate sub-type based on sub-id.
  *
  * @param id sub-type id
  * @return sub-type of IronChestplate.
  */
 public static IronChestplateMat getByID(final int id) {
   IronChestplateMat mat = byID.get((short) id);
   if (mat == null) {
     mat = new IronChestplateMat(id);
     if ((id > 0) && (id < IRON_CHESTPLATE.getBaseDurability())) {
       IronChestplateMat.register(mat);
     }
   }
   return mat;
 }
Пример #3
0
 static {
   IronChestplateMat.register(IRON_CHESTPLATE);
 }
Пример #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 IronChestplateMat element) {
   byID.put(element.getType(), element);
   byName.put(element.getTypeName(), element);
 }