diff --git a/common/src/main/java/me/lojosho/hibiscuscommons/api/events/HibiscusHookReload.java b/common/src/main/java/me/lojosho/hibiscuscommons/api/events/HibiscusHookReload.java index 9af8a96..a7f277c 100644 --- a/common/src/main/java/me/lojosho/hibiscuscommons/api/events/HibiscusHookReload.java +++ b/common/src/main/java/me/lojosho/hibiscuscommons/api/events/HibiscusHookReload.java @@ -11,8 +11,11 @@ public class HibiscusHookReload extends HibiscusHookEvent { private static final HandlerList handlers = new HandlerList(); - public HibiscusHookReload(Hook hook) { + private final ReloadType reloadType; + + public HibiscusHookReload(Hook hook, ReloadType reloadType) { super(hook); + this.reloadType = reloadType; } @NotNull @@ -25,4 +28,13 @@ public class HibiscusHookReload extends HibiscusHookEvent { public static HandlerList getHandlerList() { return handlers; } + + public ReloadType getReloadType() { + return reloadType; + } + + public enum ReloadType { + INITIAL, + RELOAD + } } diff --git a/common/src/main/java/me/lojosho/hibiscuscommons/hooks/items/HookItemAdder.java b/common/src/main/java/me/lojosho/hibiscuscommons/hooks/items/HookItemAdder.java index 5beb8cc..5ccb40e 100644 --- a/common/src/main/java/me/lojosho/hibiscuscommons/hooks/items/HookItemAdder.java +++ b/common/src/main/java/me/lojosho/hibiscuscommons/hooks/items/HookItemAdder.java @@ -39,11 +39,10 @@ public class HookItemAdder extends Hook { @EventHandler(priority = EventPriority.MONITOR) public void onItemAdderDataLoad(ItemsAdderLoadDataEvent event) { - HibiscusHookReload newEvent = new HibiscusHookReload(this); - Bukkit.getPluginManager().callEvent(newEvent); - //if (enabled && !Settings.isItemsAdderChangeReload()) return; + HibiscusHookReload.ReloadType reloadType = enabled ? HibiscusHookReload.ReloadType.RELOAD : HibiscusHookReload.ReloadType.INITIAL; this.enabled = true; - //HMCCosmeticsPlugin.setup(); + HibiscusHookReload newEvent = new HibiscusHookReload(this, reloadType); + Bukkit.getPluginManager().callEvent(newEvent); } public String getItemString(ItemStack itemStack) {