diff --git a/build.gradle.kts b/build.gradle.kts index 7b1c386e..5ffde1f3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -91,7 +91,7 @@ allprojects { compileOnly("io.github.toxicity188:BetterCommand:1.3") //BetterCommand library //compileOnly("it.unimi.dsi:fastutil:8.5.14") compileOnly("org.projectlombok:lombok:1.18.34") - compileOnly("me.lojosho:HibiscusCommons:0.7.0-d301221e") + compileOnly("me.lojosho:HibiscusCommons:0.7.0-491f46f") // Handled by Spigot Library Loader compileOnly("net.kyori:adventure-api:4.23.0") @@ -144,6 +144,7 @@ tasks { downloadPlugins { hangar("PlaceholderAPI", "2.11.6") url("https://download.luckperms.net/1593/bukkit/loader/LuckPerms-Bukkit-5.5.8.jar") + github("Test-Account666", "PlugManX", "2.4.1", "PlugManX-2.4.1.jar") } } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/packets/CosmeticPacketInterface.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/packets/CosmeticPacketInterface.java index b49dc680..13e22008 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/packets/CosmeticPacketInterface.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/packets/CosmeticPacketInterface.java @@ -27,27 +27,32 @@ public class CosmeticPacketInterface implements PacketInterface { @Override public PacketAction writeContainerContent(@NotNull Player player, @NotNull ContainerContentWrapper wrapper) { int windowId = wrapper.getWindowId(); + MessagesUtil.sendDebugMessages("writeContainerContent (windowid: " + windowId + " )"); if (windowId != 0) return PacketAction.NOTHING; List slotData = wrapper.getSlotData(); CosmeticUser user = CosmeticUsers.getUser(player); if (user == null) return PacketAction.NOTHING; - HashMap items = new HashMap<>(); + HashMap cosmeticItems = new HashMap<>(); - if (!user.isInWardrobe()) for (Cosmetic cosmetic : user.getCosmetics()) if (cosmetic instanceof CosmeticArmorType armorType) { - boolean requireEmpty = Settings.getSlotOption(armorType.getEquipSlot()).isRequireEmpty(); - boolean isAir = user.getPlayer().getInventory().getItem(armorType.getEquipSlot()).getType().isAir(); - MessagesUtil.sendDebugMessages("Menu Fired (Checks) - " + armorType.getId() + " - " + requireEmpty + " - " + isAir); - if (requireEmpty && !isAir) continue; - items.put(HMCCInventoryUtils.getPacketArmorSlot(armorType.getEquipSlot()), user.getUserCosmeticItem(armorType)); + if (!user.isInWardrobe()) { + for (Cosmetic cosmetic : user.getCosmetics()) { + if (cosmetic instanceof CosmeticArmorType armorType) { + boolean requireEmpty = Settings.getSlotOption(armorType.getEquipSlot()).isRequireEmpty(); + boolean isAir = user.getPlayer().getInventory().getItem(armorType.getEquipSlot()).getType().isAir(); + MessagesUtil.sendDebugMessages("Menu Fired (Checks) - " + armorType.getId() + " - " + requireEmpty + " - " + isAir); + if (requireEmpty && !isAir) continue; + cosmeticItems.put(HMCCInventoryUtils.getPacketArmorSlot(armorType.getEquipSlot()), user.getUserCosmeticItem(armorType)); + } + } } for (int slot = 0; slot < 46; slot++) { if ((slot >= 5 && slot <= 8) || slot == 45) { - if (!items.containsKey(slot)) continue; - slotData.set(slot, items.get(slot)); - if (Settings.isDebugMode()) MessagesUtil.sendDebugMessages("Set " + slot + " as " + items.get(slot)); + if (!cosmeticItems.containsKey(slot)) continue; + slotData.set(slot, cosmeticItems.get(slot)); + if (Settings.isDebugMode()) MessagesUtil.sendDebugMessages("Set " + slot + " as " + cosmeticItems.get(slot)); } }