use of net.md_5.bungee.api.chat.BaseComponent in project Denizen-For-Bukkit by DenizenScript.
the class ItemHelperImpl method getLore.
@Override
public List<String> getLore(ItemTag item) {
if (!item.getItemMeta().hasLore()) {
return null;
}
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item.getItemStack());
ListTag list = ((net.minecraft.nbt.CompoundTag) nmsItemStack.getTag().get("display")).getList("Lore", 8);
List<String> outList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
BaseComponent[] lineComponent = ComponentSerializer.parse(list.getString(i));
outList.add(FormattedTextHelper.stringify(lineComponent, ChatColor.WHITE));
}
return outList;
}
Aggregations