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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user