mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2024-11-21 11:45:11 +01:00
add a pdc method to the itembuilder
This commit is contained in:
parent
30ada8a071
commit
aff5f61c57
@ -2,6 +2,7 @@ package com.badbones69.crazyauctions.api.builders;
|
||||
|
||||
import com.badbones69.crazyauctions.CrazyAuctions;
|
||||
import com.badbones69.crazyauctions.Methods;
|
||||
import com.badbones69.crazyauctions.api.enums.misc.Keys;
|
||||
import com.badbones69.crazyauctions.api.support.SkullCreator;
|
||||
import com.ryderbelserion.vital.paper.api.enums.Support;
|
||||
import io.th0rgal.oraxen.api.OraxenItems;
|
||||
@ -26,6 +27,8 @@ import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.inventory.meta.trim.ArmorTrim;
|
||||
import org.bukkit.inventory.meta.trim.TrimMaterial;
|
||||
import org.bukkit.inventory.meta.trim.TrimPattern;
|
||||
import org.bukkit.persistence.PersistentDataContainer;
|
||||
import org.bukkit.persistence.PersistentDataType;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.potion.PotionData;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
@ -715,6 +718,18 @@ public class ItemBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemBuilder addString(String name) {
|
||||
if (name.isEmpty()) return this;
|
||||
|
||||
this.itemStack.editMeta(itemMeta -> {
|
||||
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
|
||||
|
||||
container.set(Keys.auction_button.getNamespacedKey(), PersistentDataType.STRING, name);
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the lore of the item with papi support in the builder. This will auto force color in all the lores that contains color code. (&a, &c, &7, etc...)
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user