9
0
mirror of https://github.com/HibiscusMC/HibiscusCommons.git synced 2025-12-19 15:09:26 +00:00

fix: improvement to HibiscusHookReload for IA

This commit is contained in:
LoJoSho
2023-12-28 20:36:18 -06:00
parent aef60ee81d
commit 609a785bff
2 changed files with 16 additions and 5 deletions

View File

@@ -11,8 +11,11 @@ public class HibiscusHookReload extends HibiscusHookEvent {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
public HibiscusHookReload(Hook hook) { private final ReloadType reloadType;
public HibiscusHookReload(Hook hook, ReloadType reloadType) {
super(hook); super(hook);
this.reloadType = reloadType;
} }
@NotNull @NotNull
@@ -25,4 +28,13 @@ public class HibiscusHookReload extends HibiscusHookEvent {
public static HandlerList getHandlerList() { public static HandlerList getHandlerList() {
return handlers; return handlers;
} }
public ReloadType getReloadType() {
return reloadType;
}
public enum ReloadType {
INITIAL,
RELOAD
}
} }

View File

@@ -39,11 +39,10 @@ public class HookItemAdder extends Hook {
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onItemAdderDataLoad(ItemsAdderLoadDataEvent event) { public void onItemAdderDataLoad(ItemsAdderLoadDataEvent event) {
HibiscusHookReload newEvent = new HibiscusHookReload(this); HibiscusHookReload.ReloadType reloadType = enabled ? HibiscusHookReload.ReloadType.RELOAD : HibiscusHookReload.ReloadType.INITIAL;
Bukkit.getPluginManager().callEvent(newEvent);
//if (enabled && !Settings.isItemsAdderChangeReload()) return;
this.enabled = true; this.enabled = true;
//HMCCosmeticsPlugin.setup(); HibiscusHookReload newEvent = new HibiscusHookReload(this, reloadType);
Bukkit.getPluginManager().callEvent(newEvent);
} }
public String getItemString(ItemStack itemStack) { public String getItemString(ItemStack itemStack) {