use of org.bukkit.inventory.meta.ItemMeta in project SpaciousLib by anhcraft.
the class SItems method setLores.
/**
* Set lores for an item
*
* @param texts the lores
*/
public void setLores(List<String> texts) {
ItemMeta a = this.item.getItemMeta();
List<String> lores = new ArrayList<>();
for (String b : texts) {
lores.add(b.replace("&", "§"));
}
a.setLore(lores);
this.item.setItemMeta(a);
}
use of org.bukkit.inventory.meta.ItemMeta in project SpaciousLib by anhcraft.
the class SItems method flag.
/**
* Set flags for an item
*
* @param flag the flag
*/
public void flag(ItemFlag flag) {
ItemMeta a = this.item.getItemMeta();
a.addItemFlags(flag);
this.item.setItemMeta(a);
}
use of org.bukkit.inventory.meta.ItemMeta in project SpaciousLib by anhcraft.
the class SItems method removeEnchant.
/**
* Remove an echantment of an item
*
* @param enchant the enchant name
*/
public void removeEnchant(Enchantment enchant) {
ItemMeta a = this.item.getItemMeta();
a.removeEnchant(enchant);
this.item.setItemMeta(a);
}
use of org.bukkit.inventory.meta.ItemMeta in project SpaciousLib by anhcraft.
the class SItems method addLore.
/**
* Add lore for an item
*
* @param text the lore
*/
public void addLore(String text) {
ItemMeta a = this.item.getItemMeta();
List<String> lores;
if (a.hasLore()) {
lores = a.getLore();
} else {
lores = new ArrayList<>();
}
lores.add(text.replace("&", "§"));
a.setLore(lores);
this.item.setItemMeta(a);
}
use of org.bukkit.inventory.meta.ItemMeta in project SpaciousLib by anhcraft.
the class SItems method setLore.
/**
* Set lore for an item
*
* @param texts the lores
*/
public void setLore(String texts) {
ItemMeta a = this.item.getItemMeta();
List<String> lores = new ArrayList<>();
lores.add(texts.replace("&", "§"));
a.setLore(lores);
this.item.setItemMeta(a);
}
Aggregations