7 |
import org.bukkit.plugin.PluginManager; |
import org.bukkit.plugin.PluginManager; |
8 |
import org.bukkit.plugin.java.JavaPlugin; |
import org.bukkit.plugin.java.JavaPlugin; |
9 |
|
|
10 |
|
import dk.thoerup.bukkit.hoeruputils.chests.AdvancedChest; |
11 |
|
import dk.thoerup.bukkit.hoeruputils.chests.ChestBean; |
12 |
import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; |
import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; |
13 |
import dk.thoerup.bukkit.hoeruputils.message.MessageBean; |
import dk.thoerup.bukkit.hoeruputils.message.MessageBean; |
14 |
import dk.thoerup.bukkit.hoeruputils.message.MessageWrapper; |
import dk.thoerup.bukkit.hoeruputils.message.MessageWrapper; |
15 |
import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener; |
import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener; |
16 |
import dk.thoerup.bukkit.hoeruputils.web.WebLoader; |
import dk.thoerup.bukkit.hoeruputils.web.WebLoader; |
17 |
|
import dk.thoerup.bukkit.hoeruputils.web.WebUser; |
18 |
|
import dk.thoerup.bukkit.hoeruputils.web.WebUserCommand; |
19 |
|
|
20 |
public class HoerupUtilsPlugin extends JavaPlugin { |
public class HoerupUtilsPlugin extends JavaPlugin { |
21 |
|
|
46 |
HomeCommand home = new HomeCommand(this); |
HomeCommand home = new HomeCommand(this); |
47 |
getCommand("home").setExecutor( home ); |
getCommand("home").setExecutor( home ); |
48 |
getCommand("sethome").setExecutor( home ); |
getCommand("sethome").setExecutor( home ); |
49 |
|
getCommand("ophome").setExecutor( home ); |
50 |
|
|
51 |
DiverCommand diver = new DiverCommand(this ); |
DiverCommand diver = new DiverCommand(this ); |
52 |
getCommand("diver").setExecutor( diver ); |
getCommand("diver").setExecutor( diver ); |
60 |
getCommand("platform").setExecutor( generalContractor ); |
getCommand("platform").setExecutor( generalContractor ); |
61 |
getCommand("cylinder").setExecutor( generalContractor ); |
getCommand("cylinder").setExecutor( generalContractor ); |
62 |
getCommand("createcave").setExecutor( generalContractor ); |
getCommand("createcave").setExecutor( generalContractor ); |
63 |
|
getCommand("spawn").setExecutor( new SpawnCommand() ); |
64 |
|
|
65 |
getCommand("template").setExecutor( new TemplateCommand(this) ); |
getCommand("template").setExecutor( new TemplateCommand(this) ); |
66 |
|
|
70 |
PluginManager pm = getServer().getPluginManager(); |
PluginManager pm = getServer().getPluginManager(); |
71 |
|
|
72 |
|
|
73 |
|
MotdHandler motd = new MotdHandler(this); |
74 |
|
getCommand("motd").setExecutor( motd ); |
75 |
|
pm.registerEvents( motd, this); |
76 |
|
|
77 |
|
|
78 |
pm.registerEvents(logintimeHandler, this); |
pm.registerEvents(logintimeHandler, this); |
79 |
pm.registerEvents(logintimeHandler, this); |
pm.registerEvents(logintimeHandler, this); |
80 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
|
SnitchingChest snitch = new SnitchingChest(this); |
|
|
getCommand("snitchingchest").setExecutor(snitch); |
|
|
pm.registerEvents( snitch, this); |
|
88 |
|
|
89 |
|
|
90 |
|
|
96 |
} |
} |
97 |
}; |
}; |
98 |
messageWrapper = new MessageWrapper(this, ddlInstaller); |
messageWrapper = new MessageWrapper(this, ddlInstaller); |
99 |
pm.registerEvents( messageWrapper, this); |
pm.registerEvents( messageWrapper, this); |
100 |
|
|
101 |
|
AdvancedChest locked = new AdvancedChest(this, ddlInstaller); |
102 |
|
getCommand("chest").setExecutor(locked); |
103 |
|
pm.registerEvents( locked, this); |
104 |
|
|
105 |
|
|
106 |
|
getCommand("webuser").setExecutor( new WebUserCommand(this,ddlInstaller) ); |
107 |
|
|
108 |
|
|
109 |
//register web plugins |
//register web plugins |
110 |
//pm.registerEvent(Event.Type.CUSTOM_EVENT, new StatusListener(getServer(), logintimeHandler.getConfig(), home.getConfig() ), Priority.Normal, this); |
//pm.registerEvent(Event.Type.CUSTOM_EVENT, new StatusListener(getServer(), logintimeHandler.getConfig(), home.getConfig() ), Priority.Normal, this); |
116 |
Class.forName("de.codeinfection.quickwango.ApiBukkit.ApiServer.ApiController"); //if it fails it throws an exception |
Class.forName("de.codeinfection.quickwango.ApiBukkit.ApiServer.ApiController"); //if it fails it throws an exception |
117 |
WebLoader.getInstance().load(this, logintimeHandler.getConfig(), home.getConfig()); |
WebLoader.getInstance().load(this, logintimeHandler.getConfig(), home.getConfig()); |
118 |
|
|
119 |
getLogger().warning("ApiBukkit found, status listener registered"); |
getLogger().info("ApiBukkit found, status listener registered"); |
120 |
|
|
121 |
} catch (ClassNotFoundException e) { |
} catch (ClassNotFoundException e) { |
122 |
getLogger().warning("Could not find ApiBukkit - web status is disabled" ); |
getLogger().warning("Could not find ApiBukkit - web status is disabled" ); |
138 |
return messageWrapper; |
return messageWrapper; |
139 |
} |
} |
140 |
|
|
141 |
@SuppressWarnings({ "unchecked", "rawtypes" }) |
//@SuppressWarnings({ "unchecked", "rawtypes" }) |
142 |
@Override |
@Override |
143 |
public List<Class<?>> getDatabaseClasses() { |
public List<Class<?>> getDatabaseClasses() { |
144 |
System.out.println("getDatabaseClasses"); |
List<Class<?>> list = new ArrayList<Class<?>>(); |
|
List list = new ArrayList(); |
|
145 |
|
|
146 |
list.add(MessageBean.class); |
list.add(MessageBean.class); |
147 |
|
list.add(ChestBean.class); |
148 |
|
list.add(WebUser.class); |
149 |
|
|
150 |
return list; |
return list; |
151 |
} |
} |