refactor(placeholder): streamline
This commit is contained in:
parent
82c210459e
commit
5cf35e5b98
2 changed files with 5 additions and 21 deletions
|
@ -18,7 +18,7 @@ import xyz.atnrch.nicko.gui.items.main.ExitGUI;
|
|||
import xyz.atnrch.nicko.i18n.Locale;
|
||||
import xyz.atnrch.nicko.i18n.LocaleFileManager;
|
||||
import xyz.atnrch.nicko.mojang.MojangAPI;
|
||||
import xyz.atnrch.nicko.placeholder.PlaceHolderHook;
|
||||
import xyz.atnrch.nicko.placeholder.NickoExpansion;
|
||||
import xyz.atnrch.nicko.storage.PlayerDataStore;
|
||||
import xyz.atnrch.nicko.storage.name.PlayerNameStore;
|
||||
import xyz.xenondevs.invui.gui.structure.Structure;
|
||||
|
@ -105,7 +105,10 @@ public class NickoBukkit extends JavaPlugin {
|
|||
Structure.addGlobalIngredient('U', new OptionUnavailable());
|
||||
Structure.addGlobalIngredient('E', new ExitGUI());
|
||||
|
||||
new PlaceHolderHook(this).hook();
|
||||
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
||||
getLogger().info("Enabling PlaceHolderAPI support...");
|
||||
new NickoExpansion(this).register();
|
||||
}
|
||||
|
||||
getServer().getPluginManager().registerEvents(new PlayerJoinListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new PlayerQuitListener(), this);
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
package xyz.atnrch.nicko.placeholder;
|
||||
|
||||
import xyz.atnrch.nicko.NickoBukkit;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class PlaceHolderHook {
|
||||
private final NickoBukkit instance;
|
||||
|
||||
public PlaceHolderHook(NickoBukkit instance) {
|
||||
this.instance = instance;
|
||||
}
|
||||
|
||||
public void hook() {
|
||||
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
||||
instance.getLogger().info("Enabling PlaceHolderAPI support...");
|
||||
new NickoExpansion(instance).register();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue