forked from HibiscusMC/HMCCosmetics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
56 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
common/src/main/java/com/hibiscusmc/hmccosmetics/listener/ServerListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.hibiscusmc.hmccosmetics.listener; | ||
|
||
import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; | ||
import com.hibiscusmc.hmccosmetics.config.Settings; | ||
import me.lojosho.hibiscuscommons.api.events.HibiscusHookReload; | ||
import me.lojosho.hibiscuscommons.hooks.Hook; | ||
import me.lojosho.hibiscuscommons.hooks.items.HookItemAdder; | ||
import me.lojosho.hibiscuscommons.hooks.items.HookNexo; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
|
||
public class ServerListener implements Listener { | ||
|
||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) | ||
public void onHookReload(HibiscusHookReload event) { | ||
Hook hook = event.getHook(); | ||
if (hook instanceof HookItemAdder) { | ||
switch (event.getReloadType()) { | ||
case INITIAL -> { | ||
HMCCosmeticsPlugin.setup(); | ||
} | ||
case RELOAD -> { | ||
if (!Settings.isItemsAdderChangeReload()) return; | ||
HMCCosmeticsPlugin.setup(); | ||
} | ||
} | ||
} | ||
if (hook instanceof HookNexo) { | ||
switch (event.getReloadType()) { | ||
case INITIAL -> { | ||
HMCCosmeticsPlugin.setup(); | ||
} | ||
case RELOAD -> { | ||
if (!Settings.isNexoChangeReload()) return; | ||
HMCCosmeticsPlugin.setup(); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters