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

fix: handle IA reloading

This commit is contained in:
LoJoSho
2023-12-28 20:49:23 -06:00
parent 0de31fcd04
commit f8cb436c5b
2 changed files with 10 additions and 3 deletions

View File

@@ -413,8 +413,15 @@ public class PlayerGameListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onHookReload(HibiscusHookReload event) {
if (event.getHook() instanceof HookItemAdder hook) {
if (hook.getIAEnabled() && !Settings.isItemsAdderChangeReload()) return;
HMCCosmeticsPlugin.setup();
switch (event.getReloadType()) {
case INITIAL -> {
HMCCosmeticsPlugin.setup();
}
case RELOAD -> {
if (!Settings.isItemsAdderChangeReload()) return;
HMCCosmeticsPlugin.setup();
}
}
}
}