SpellTome.java 文件源码

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

项目:Zephyr 作者:
public static ItemStack getSpellTome(Spell spell, User user) {
    ItemStack stack = new ItemStack(Material.WRITTEN_BOOK);
    BookMeta meta = (BookMeta) stack.getItemMeta();

    StringBuilder page = new StringBuilder();

    page.append("Spell: " + spell.getName() + "\n");
    page.append(spell.getDescription() + "\n");
    page.append("Mana Cost: " + spell.getManaCost());
    page.append("\n\n");
    page.append("Cast this spell with /cast " + WordUtils.capitalize(spell.getName()) + "\n\n");
    page.append("Learn this spell by left clicking the book");

    meta.setPages(page.toString());
    meta.setAuthor(user.<Player> getPlayer().getName());
    meta.setDisplayName(ChatColor.GOLD + "Spell Tome" + ChatColor.GRAY + SEPERATOR
            + WordUtils.capitalize(spell.getName()));
    meta.setLore(Lists.newArrayList(ChatColor.GRAY + "Learn by left clicking"));
    stack.setItemMeta(meta);
    return stack;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号