Hotfix for plugin not loading without fsb

This commit is contained in:
Fabrizio La Rosa 2020-07-09 13:27:22 +02:00 committed by Brianna
parent cfa150bdef
commit c0f0d8ed8e
2 changed files with 21 additions and 7 deletions

View File

@ -12,6 +12,7 @@ import com.songoda.epicfurnaces.boost.BoostData;
import com.songoda.epicfurnaces.boost.BoostManager; import com.songoda.epicfurnaces.boost.BoostManager;
import com.songoda.epicfurnaces.commands.*; import com.songoda.epicfurnaces.commands.*;
import com.songoda.epicfurnaces.compatibility.EpicFurnacesPermission; import com.songoda.epicfurnaces.compatibility.EpicFurnacesPermission;
import com.songoda.epicfurnaces.compatibility.FabledSkyBlockLoader;
import com.songoda.epicfurnaces.furnace.Furnace; import com.songoda.epicfurnaces.furnace.Furnace;
import com.songoda.epicfurnaces.furnace.FurnaceBuilder; import com.songoda.epicfurnaces.furnace.FurnaceBuilder;
import com.songoda.epicfurnaces.furnace.FurnaceManager; import com.songoda.epicfurnaces.furnace.FurnaceManager;
@ -99,13 +100,7 @@ public class EpicFurnaces extends SongodaPlugin {
// Hook into FabledSkyBlock // Hook into FabledSkyBlock
if (Bukkit.getPluginManager().isPluginEnabled("FabledSkyBlock")) { if (Bukkit.getPluginManager().isPluginEnabled("FabledSkyBlock")) {
SkyBlock.getInstance().getPermissionManager().registerPermission(new EpicFurnacesPermission()); new FabledSkyBlockLoader();
try {
SkyBlock.getInstance().getPermissionManager().registerPermission(
(BasicPermission) Class.forName("com.songoda.epicfurnaces.compatibility.EpicFurnacesPermission").getDeclaredConstructor().newInstance());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
e.printStackTrace();
}
} }

View File

@ -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();
}
}
}