fixed denizen hook

This commit is contained in:
Indyuce 2021-08-12 01:00:19 +02:00
parent f5474ef520
commit 7b4e735547
2 changed files with 20 additions and 4 deletions

View File

@ -1,6 +1,5 @@
package net.Indyuce.mmoitems;
import com.denizenscript.depenizen.bukkit.Depenizen;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackCategory;
import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackMessage;
@ -17,7 +16,7 @@ import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.api.util.message.FFPMMOItems;
import net.Indyuce.mmoitems.command.MMOItemsCommandTreeRoot;
import net.Indyuce.mmoitems.comp.*;
import net.Indyuce.mmoitems.comp.denizen.DenizenBridge;
import net.Indyuce.mmoitems.comp.denizen.DenizenHook;
import net.Indyuce.mmoitems.comp.eco.VaultSupport;
import net.Indyuce.mmoitems.comp.enchants.AdvancedEnchantmentsHook;
import net.Indyuce.mmoitems.comp.enchants.CrazyEnchantsStat;
@ -143,8 +142,7 @@ public class MMOItems extends LuminePlugin {
enchantPlugins.add(new MythicEnchantsSupport());
if (Bukkit.getPluginManager().getPlugin("Depenizen") != null) {
Depenizen depenizen = (Depenizen) Bukkit.getPluginManager().getPlugin("Depenizen");
depenizen.registerBridge(getName(), () -> new DenizenBridge());
new DenizenHook();
getLogger().log(Level.INFO, "Hooked onto Denizen");
}
}

View File

@ -0,0 +1,18 @@
package net.Indyuce.mmoitems.comp.denizen;
import com.denizenscript.depenizen.bukkit.Depenizen;
import net.Indyuce.mmoitems.MMOItems;
import org.bukkit.Bukkit;
public class DenizenHook {
/**
* Putting this here so that the Depenizen import does not
* appear in the main MMOItems class which would cause an issue
* for all servers without Denizen
*/
public DenizenHook() {
Depenizen depenizen = (Depenizen) Bukkit.getPluginManager().getPlugin("Depenizen");
depenizen.registerBridge(MMOItems.plugin.getName(), () -> new DenizenBridge());
}
}