--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java 2012/03/21 17:19:31 1761 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java 2012/03/21 19:24:25 1762 @@ -9,6 +9,7 @@ import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener; +import dk.thoerup.bukkit.hoeruputils.web.WebLoader; public class HoerupUtilsPlugin extends JavaPlugin { @@ -77,19 +78,14 @@ try { try { //først probes om klassen i det hele taget findes - Class.forName("de.codeinfection.quickwango.ApiBukkit.ApiServer.ApiController"); - - Classwebloader = Class.forName("dk.thoerup.bukkit.hoeruputils.web.WebLoader"); - Method load = webloader.getMethod("load", HoerupUtilsPlugin.class, Configuration.class, Configuration.class); - Object args[] = {this, logintimeHandler.getConfig(), home.getConfig() }; - load.invoke(null, args); - + Class.forName("de.codeinfection.quickwango.ApiBukkit.ApiServer.ApiController"); //if it fails it throws an exception + WebLoader.getInstance().load(this, logintimeHandler.getConfig(), home.getConfig()); + getLogger().warning("ApiBukkit found, status listener registered"); } catch (ClassNotFoundException e) { getLogger().warning("Could not find ApiBukkit - web status is disabled" ); - } - + } } catch (Throwable e) { //instead of ClassNotFoundException + NoSuchMethodException + InvocationTargetException + IllegalAccessException getLogger().warning("Could not find ApiBukkit - web status is disabled (" + e.getClass().getName() + ":" + e.getMessage() + ")" ); }