public void setLore(String[] strings) { // this.lore.add(str); NBTTagCompound displayCompound = nmsStack.getTag().getCompound("display"); if (displayCompound == null) { displayCompound = new NBTTagCompound(); } NBTTagList loreList = new NBTTagList(); for (String str : strings) { loreList.add(new NBTTagString(str)); } displayCompound.set("Lore", loreList); nmsStack.getTag().set("display", displayCompound); }
public void addLore(String str) { if (nmsStack == null) { return; } if (nmsStack.getTag() == null) { nmsStack.setTag(new NBTTagCompound()); } // this.lore.add(str); NBTTagCompound displayCompound = nmsStack.getTag().getCompound("display"); if (displayCompound == null) { displayCompound = new NBTTagCompound(); } NBTTagList loreList = displayCompound.getList("Lore", NBTStaticHelper.TAG_STRING); if (loreList == null) { loreList = new NBTTagList(); } loreList.add(new NBTTagString(str)); displayCompound.set("Lore", loreList); nmsStack.getTag().set("display", displayCompound); }
/** * Add a new attribute to the list. * * @param attribute - the new attribute. */ public void add(Attribute attribute) { attributes.add(attribute.data); }