update keys

This commit is contained in:
Ryder Belserion 2024-10-12 17:23:57 -04:00
parent 2825787e7e
commit 2ee5286b54
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View File

@ -718,23 +718,23 @@ public class ItemBuilder {
return this;
}
public ItemBuilder addString(String name) {
public ItemBuilder addString(String name, NamespacedKey key) {
if (name.isEmpty()) return this;
this.itemStack.editMeta(itemMeta -> {
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
container.set(Keys.auction_button.getNamespacedKey(), PersistentDataType.STRING, name);
container.set(key, PersistentDataType.STRING, name);
});
return this;
}
public ItemBuilder addInteger(int value) {
public ItemBuilder addInteger(int value, NamespacedKey key) {
this.itemStack.editMeta(itemMeta -> {
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
container.set(Keys.auction_price.getNamespacedKey(), PersistentDataType.INTEGER, value);
container.set(key, PersistentDataType.INTEGER, value);
});
return this;

View File

@ -65,7 +65,7 @@ public class CategoriesMenu extends Holder {
String name = this.config.getString("Settings.GUISettings." + key + ".Name");
int slot = this.config.getInt("Settings.GUISettings." + key + ".Slot");
ItemBuilder itemBuilder = new ItemBuilder().setMaterial(id).setName(name).addString(key).setAmount(1);
ItemBuilder itemBuilder = new ItemBuilder().setMaterial(id).setName(name).addString(key, Keys.auction_button.getNamespacedKey()).setAmount(1);
if (this.config.contains("Settings.GUISettings." + key + ".Lore")) {
itemBuilder.setLore(this.config.getStringList("Settings.GUISettings." + key + ".Lore"));

View File

@ -74,7 +74,7 @@ public class CurrentMenu extends Holder {
String name = this.config.getString("Settings.GUISettings.OtherSettings." + key + ".Name");
int slot = this.config.getInt("Settings.GUISettings.OtherSettings." + key + ".Slot");
ItemBuilder itemBuilder = new ItemBuilder().setMaterial(id).setName(name).addString(key).setAmount(1);
ItemBuilder itemBuilder = new ItemBuilder().setMaterial(id).setName(name).addString(key, Keys.auction_button.getNamespacedKey()).setAmount(1);
if (this.config.contains("Settings.GUISettings.OtherSettings." + key + ".Lore")) {
itemBuilder.setLore(this.config.getStringList("Settings.GUISettings.OtherSettings." + key + ".Lore"));