mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-30 20:39:13 +00:00
feat: menu now passes int slot to gui item types
This commit is contained in:
@@ -196,7 +196,7 @@ public class Menu {
|
||||
@NotNull
|
||||
private ItemStack updateItem(CosmeticUser user, @NotNull ItemStack itemStack, Type type, ConfigurationNode config, int slot) {
|
||||
if (itemStack.hasItemMeta()) {
|
||||
itemStack = type.setItem(user, config, itemStack);
|
||||
itemStack = type.setItem(user, config, itemStack, slot);
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ public abstract class Type {
|
||||
|
||||
public abstract void run(CosmeticUser user, ConfigurationNode config, ClickType clickType);
|
||||
|
||||
public abstract ItemStack setItem(CosmeticUser user, ConfigurationNode config, ItemStack itemStack);
|
||||
public abstract ItemStack setItem(CosmeticUser user, ConfigurationNode config, ItemStack itemStack, int slot);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class TypeCosmetic extends Type {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack setItem(CosmeticUser user, @NotNull ConfigurationNode config, ItemStack itemStack) {
|
||||
public ItemStack setItem(CosmeticUser user, @NotNull ConfigurationNode config, ItemStack itemStack, int slot) {
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
|
||||
if (config.node("cosmetic").virtual()) {
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TypeEmpty extends Type {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("Duplicates")
|
||||
public ItemStack setItem(CosmeticUser user, ConfigurationNode config, @NotNull ItemStack itemStack) {
|
||||
public ItemStack setItem(CosmeticUser user, ConfigurationNode config, @NotNull ItemStack itemStack, int slot) {
|
||||
List<String> processedLore = new ArrayList<>();
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user