9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-30 12:29:16 +00:00

feat: menu now passes int slot to gui item types

This commit is contained in:
LoJoSho
2023-05-06 09:37:54 -05:00
parent e59717d61d
commit ebc7bfa30a
4 changed files with 4 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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()) {

View File

@@ -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();