protected StoneAxeMat(final int durability) { super( STONE_AXE.name(), STONE_AXE.getId(), STONE_AXE.getMinecraftId(), Integer.toString(durability), (short) durability, ToolMaterial.STONE); }
/** * Returns one of StoneAxe sub-type based on sub-id. * * @param id sub-type id * @return sub-type of StoneAxe. */ public static StoneAxeMat getByID(final int id) { StoneAxeMat mat = byID.get((short) id); if (mat == null) { mat = new StoneAxeMat(id); if ((id > 0) && (id < STONE_AXE.getBaseDurability())) { StoneAxeMat.register(mat); } } return mat; }
static { StoneAxeMat.register(STONE_AXE); }
/** * 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 StoneAxeMat element) { byID.put(element.getType(), element); byName.put(element.getTypeName(), element); }