mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2025-02-13 01:11:25 +01:00
use decorationIfAbsent
This commit is contained in:
parent
e110230d24
commit
27582743d3
@ -166,12 +166,8 @@ public class BaseItemBuilder<Base extends BaseItemBuilder<Base>> {
|
|||||||
this.itemMeta = itemStack.hasItemMeta() ? itemStack.getItemMeta() : Bukkit.getServer().getItemFactory().getItemMeta(material);
|
this.itemMeta = itemStack.hasItemMeta() ? itemStack.getItemMeta() : Bukkit.getServer().getItemFactory().getItemMeta(material);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDisplayName(Component displayName) {
|
public Base setDisplayName(Component displayName) {
|
||||||
this.itemMeta.displayName(displayName);
|
this.itemMeta.displayName(displayName.decorationIfAbsent(TextDecoration.ITALIC, TextDecoration.State.FALSE));
|
||||||
}
|
|
||||||
|
|
||||||
public Base setDisplayName(Component displayName, boolean removeItalics) {
|
|
||||||
if (removeItalics) { this.itemMeta.displayName(displayName.decoration(TextDecoration.ITALIC, false)); } else setDisplayName(displayName);
|
|
||||||
return (Base) this;
|
return (Base) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user