9 |
|
|
10 |
import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; |
import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; |
11 |
import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener; |
import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener; |
12 |
|
import dk.thoerup.bukkit.hoeruputils.web.WebLoader; |
13 |
|
|
14 |
public class HoerupUtilsPlugin extends JavaPlugin { |
public class HoerupUtilsPlugin extends JavaPlugin { |
15 |
|
|
78 |
try { |
try { |
79 |
try { |
try { |
80 |
//først probes om klassen i det hele taget findes |
//først probes om klassen i det hele taget findes |
81 |
Class.forName("de.codeinfection.quickwango.ApiBukkit.ApiServer.ApiController"); |
Class.forName("de.codeinfection.quickwango.ApiBukkit.ApiServer.ApiController"); //if it fails it throws an exception |
82 |
|
WebLoader.getInstance().load(this, logintimeHandler.getConfig(), home.getConfig()); |
83 |
Class<?>webloader = 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); |
|
|
|
|
84 |
getLogger().warning("ApiBukkit found, status listener registered"); |
getLogger().warning("ApiBukkit found, status listener registered"); |
85 |
|
|
86 |
} catch (ClassNotFoundException e) { |
} catch (ClassNotFoundException e) { |
87 |
getLogger().warning("Could not find ApiBukkit - web status is disabled" ); |
getLogger().warning("Could not find ApiBukkit - web status is disabled" ); |
88 |
} |
} |
|
|
|
89 |
} catch (Throwable e) { //instead of ClassNotFoundException + NoSuchMethodException + InvocationTargetException + IllegalAccessException |
} catch (Throwable e) { //instead of ClassNotFoundException + NoSuchMethodException + InvocationTargetException + IllegalAccessException |
90 |
getLogger().warning("Could not find ApiBukkit - web status is disabled (" + e.getClass().getName() + ":" + e.getMessage() + ")" ); |
getLogger().warning("Could not find ApiBukkit - web status is disabled (" + e.getClass().getName() + ":" + e.getMessage() + ")" ); |
91 |
} |
} |