NonrepairableItemStack.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:MythicDrops 作者:
/**
 * Instantiates an ItemStack with a display name, lore, enchantments, and a cost for repairing.
 *
 * @param type material
 * @param amount amount
 * @param durability damage / durability
 * @param displayName name of item
 * @param lore lore for item
 * @param enchantments enchantments for item
 * @param cost experience level cost to repair
 */
public NonrepairableItemStack(Material type, int amount, short durability, String displayName,
    List<String> lore,
    Map<Enchantment, Integer> enchantments, int cost) {
  super(type, amount, durability, displayName, lore, enchantments);
  if (this.getItemMeta() instanceof Repairable) {
    Repairable repairable = (Repairable) this.getItemMeta();
    repairable.setRepairCost(cost);
    setItemMeta((ItemMeta) repairable);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号