mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2025-02-16 01:42:18 +01:00
update keys
This commit is contained in:
parent
2825787e7e
commit
2ee5286b54
@ -718,23 +718,23 @@ public class ItemBuilder {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder addString(String name) {
|
public ItemBuilder addString(String name, NamespacedKey key) {
|
||||||
if (name.isEmpty()) return this;
|
if (name.isEmpty()) return this;
|
||||||
|
|
||||||
this.itemStack.editMeta(itemMeta -> {
|
this.itemStack.editMeta(itemMeta -> {
|
||||||
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
|
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
|
||||||
|
|
||||||
container.set(Keys.auction_button.getNamespacedKey(), PersistentDataType.STRING, name);
|
container.set(key, PersistentDataType.STRING, name);
|
||||||
});
|
});
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder addInteger(int value) {
|
public ItemBuilder addInteger(int value, NamespacedKey key) {
|
||||||
this.itemStack.editMeta(itemMeta -> {
|
this.itemStack.editMeta(itemMeta -> {
|
||||||
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
|
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
|
||||||
|
|
||||||
container.set(Keys.auction_price.getNamespacedKey(), PersistentDataType.INTEGER, value);
|
container.set(key, PersistentDataType.INTEGER, value);
|
||||||
});
|
});
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
@ -65,7 +65,7 @@ public class CategoriesMenu extends Holder {
|
|||||||
String name = this.config.getString("Settings.GUISettings." + key + ".Name");
|
String name = this.config.getString("Settings.GUISettings." + key + ".Name");
|
||||||
int slot = this.config.getInt("Settings.GUISettings." + key + ".Slot");
|
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")) {
|
if (this.config.contains("Settings.GUISettings." + key + ".Lore")) {
|
||||||
itemBuilder.setLore(this.config.getStringList("Settings.GUISettings." + key + ".Lore"));
|
itemBuilder.setLore(this.config.getStringList("Settings.GUISettings." + key + ".Lore"));
|
||||||
|
@ -74,7 +74,7 @@ public class CurrentMenu extends Holder {
|
|||||||
String name = this.config.getString("Settings.GUISettings.OtherSettings." + key + ".Name");
|
String name = this.config.getString("Settings.GUISettings.OtherSettings." + key + ".Name");
|
||||||
int slot = this.config.getInt("Settings.GUISettings.OtherSettings." + key + ".Slot");
|
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")) {
|
if (this.config.contains("Settings.GUISettings.OtherSettings." + key + ".Lore")) {
|
||||||
itemBuilder.setLore(this.config.getStringList("Settings.GUISettings.OtherSettings." + key + ".Lore"));
|
itemBuilder.setLore(this.config.getStringList("Settings.GUISettings.OtherSettings." + key + ".Lore"));
|
||||||
|
Loading…
Reference in New Issue
Block a user