diff --git a/src/main/java/com/songoda/epicfurnaces/EpicFurnaces.java b/src/main/java/com/songoda/epicfurnaces/EpicFurnaces.java index ecf0ee5..f14e73f 100644 --- a/src/main/java/com/songoda/epicfurnaces/EpicFurnaces.java +++ b/src/main/java/com/songoda/epicfurnaces/EpicFurnaces.java @@ -12,6 +12,7 @@ import com.songoda.epicfurnaces.boost.BoostData; import com.songoda.epicfurnaces.boost.BoostManager; import com.songoda.epicfurnaces.commands.*; import com.songoda.epicfurnaces.compatibility.EpicFurnacesPermission; +import com.songoda.epicfurnaces.compatibility.FabledSkyBlockLoader; import com.songoda.epicfurnaces.furnace.Furnace; import com.songoda.epicfurnaces.furnace.FurnaceBuilder; import com.songoda.epicfurnaces.furnace.FurnaceManager; @@ -99,13 +100,7 @@ public class EpicFurnaces extends SongodaPlugin { // Hook into FabledSkyBlock if (Bukkit.getPluginManager().isPluginEnabled("FabledSkyBlock")) { - SkyBlock.getInstance().getPermissionManager().registerPermission(new EpicFurnacesPermission()); - try { - SkyBlock.getInstance().getPermissionManager().registerPermission( - (BasicPermission) Class.forName("com.songoda.epicfurnaces.compatibility.EpicFurnacesPermission").getDeclaredConstructor().newInstance()); - } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { - e.printStackTrace(); - } + new FabledSkyBlockLoader(); } diff --git a/src/main/java/com/songoda/epicfurnaces/compatibility/FabledSkyBlockLoader.java b/src/main/java/com/songoda/epicfurnaces/compatibility/FabledSkyBlockLoader.java new file mode 100644 index 0000000..9ff6bf4 --- /dev/null +++ b/src/main/java/com/songoda/epicfurnaces/compatibility/FabledSkyBlockLoader.java @@ -0,0 +1,19 @@ +package com.songoda.epicfurnaces.compatibility; + +import com.songoda.skyblock.SkyBlock; +import com.songoda.skyblock.permission.BasicPermission; + +import java.lang.reflect.InvocationTargetException; + +public class FabledSkyBlockLoader { + + public FabledSkyBlockLoader() { + SkyBlock.getInstance().getPermissionManager().registerPermission(new EpicFurnacesPermission()); + try { + SkyBlock.getInstance().getPermissionManager().registerPermission( + (BasicPermission) Class.forName("com.songoda.epicfurnaces.compatibility.EpicFurnacesPermission").getDeclaredConstructor().newInstance()); + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { + e.printStackTrace(); + } + } +}