2 |
|
|
3 |
|
|
4 |
import java.net.InetSocketAddress; |
import java.net.InetSocketAddress; |
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
5 |
import java.util.logging.Level; |
import java.util.logging.Level; |
6 |
|
|
7 |
import org.bukkit.plugin.PluginManager; |
import org.bukkit.plugin.PluginManager; |
9 |
|
|
10 |
import com.sun.net.httpserver.HttpServer; |
import com.sun.net.httpserver.HttpServer; |
11 |
|
|
|
import dk.thoerup.bukkit.hoeruputils.chests.AdvancedChest; |
|
|
import dk.thoerup.bukkit.hoeruputils.chests.ChestBean; |
|
12 |
import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; |
import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; |
|
import dk.thoerup.bukkit.hoeruputils.message.MessageBean; |
|
|
import dk.thoerup.bukkit.hoeruputils.message.MessageWrapper; |
|
13 |
import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener; |
import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener; |
14 |
import dk.thoerup.bukkit.hoeruputils.web.BanListener; |
import dk.thoerup.bukkit.hoeruputils.web.BanListener; |
15 |
import dk.thoerup.bukkit.hoeruputils.web.StatusListener; |
import dk.thoerup.bukkit.hoeruputils.web.StatusListener; |
|
import dk.thoerup.bukkit.hoeruputils.web.WebUser; |
|
|
import dk.thoerup.bukkit.hoeruputils.web.WebUserCommand; |
|
16 |
|
|
17 |
|
@SuppressWarnings("restriction") |
18 |
public class HoerupUtilsPlugin extends JavaPlugin { |
public class HoerupUtilsPlugin extends JavaPlugin { |
19 |
|
|
20 |
@Override |
@Override |
24 |
} |
} |
25 |
} |
} |
26 |
|
|
27 |
MessageWrapper messageWrapper; |
//MessageWrapper messageWrapper; //TODO: RE-ENABLE |
28 |
HttpServer server = null; |
HttpServer server = null; |
29 |
|
|
30 |
|
|
31 |
@Override |
@Override |
32 |
public void onEnable() { |
public void onEnable() { |
33 |
System.out.println("Loading HoerupUtils plugin"); |
System.out.println("Loading HoerupUtils plugin"); |
34 |
|
|
35 |
|
//Ebean.getDefaultServer(); //TODO: RE-ENABLE |
36 |
|
|
37 |
getCommand("whereis").setExecutor(new WhereisCommand(getServer())); |
getCommand("whereis").setExecutor(new WhereisCommand(getServer())); |
38 |
//getCommand("mapgen").setExecutor(new MapgenCommand(this)); |
//getCommand("mapgen").setExecutor(new MapgenCommand(this)); |
39 |
getCommand("eternalday").setExecutor(new EternalDayCommand(this)); |
getCommand("eternalday").setExecutor(new EternalDayCommand(this)); |
40 |
getCommand("getpos").setExecutor( new GetposCommand() ); |
getCommand("getpos").setExecutor( new GetposCommand() ); |
41 |
getCommand("msg").setExecutor( new MsgCommand( this ) ); |
getCommand("msg").setExecutor( new MsgCommand( this ) ); |
42 |
getCommand("tp").setExecutor( new TeleportCommand() ); |
// getCommand("tp").setExecutor( new TeleportCommand() ); |
43 |
|
|
44 |
getCommand("wall").setExecutor( new WallCommand() ); |
getCommand("wall").setExecutor( new WallCommand() ); |
45 |
getCommand("weather").setExecutor( new WeatherCommand() ); |
getCommand("weather").setExecutor( new WeatherCommand() ); |
61 |
getCommand("replay").setExecutor( generalContractor ); |
getCommand("replay").setExecutor( generalContractor ); |
62 |
getCommand("levelarea").setExecutor( generalContractor ); |
getCommand("levelarea").setExecutor( generalContractor ); |
63 |
getCommand("fillarea").setExecutor( generalContractor ); |
getCommand("fillarea").setExecutor( generalContractor ); |
64 |
|
getCommand("levelandfillarea").setExecutor( generalContractor ); |
65 |
|
|
66 |
getCommand("slopearea").setExecutor( generalContractor ); |
getCommand("slopearea").setExecutor( generalContractor ); |
67 |
getCommand("setsurface").setExecutor( generalContractor ); |
getCommand("setsurface").setExecutor( generalContractor ); |
68 |
getCommand("platform").setExecutor( generalContractor ); |
getCommand("platform").setExecutor( generalContractor ); |
71 |
getCommand("spawn").setExecutor( new SpawnCommand() ); |
getCommand("spawn").setExecutor( new SpawnCommand() ); |
72 |
|
|
73 |
getCommand("template").setExecutor( new TemplateCommand(this) ); |
getCommand("template").setExecutor( new TemplateCommand(this) ); |
74 |
|
getCommand("regenerate").setExecutor( new RegenerateCommand() ); |
75 |
|
|
76 |
|
|
77 |
LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() ); |
LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() ); |
78 |
|
|
106 |
pm.registerEvents(chunks, this); |
pm.registerEvents(chunks, this); |
107 |
getCommand("stickychunk").setExecutor(chunks); |
getCommand("stickychunk").setExecutor(chunks); |
108 |
|
|
109 |
|
Mute mute = new Mute(this); |
110 |
|
pm.registerEvents(mute, this); |
111 |
|
getCommand("mute").setExecutor(mute); |
112 |
|
getCommand("unmute").setExecutor(mute); |
113 |
|
|
114 |
|
|
115 |
Runnable ddlInstaller = new Runnable() { |
/* |
116 |
@Override |
* //TODO: RE-ENABLE |
117 |
public void run() { |
messageWrapper = new MessageWrapper(this); |
|
System.out.println("installddl"); |
|
|
installDDL(); |
|
|
} |
|
|
}; |
|
|
messageWrapper = new MessageWrapper(this, ddlInstaller); |
|
118 |
pm.registerEvents( messageWrapper, this); |
pm.registerEvents( messageWrapper, this); |
119 |
|
|
120 |
AdvancedChest locked = new AdvancedChest(this, ddlInstaller); |
AdvancedChest locked = new AdvancedChest(this); |
121 |
getCommand("chest").setExecutor(locked); |
getCommand("chest").setExecutor(locked); |
122 |
pm.registerEvents( locked, this); |
pm.registerEvents( locked, this); |
123 |
|
|
124 |
|
|
125 |
getCommand("webuser").setExecutor( new WebUserCommand(this,ddlInstaller) ); |
getCommand("webuser").setExecutor( new WebUserCommand(this) ); |
126 |
|
*/ |
127 |
|
|
128 |
//register web plugins |
//register web plugins |
129 |
//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); |
167 |
|
|
168 |
|
|
169 |
|
|
170 |
|
/* |
171 |
|
* //TODO: RE-ENABLE |
172 |
public MessageWrapper getMessageWrapper() { |
public MessageWrapper getMessageWrapper() { |
173 |
return messageWrapper; |
return messageWrapper; |
174 |
} |
} |
175 |
|
*/ |
176 |
|
|
|
//@SuppressWarnings({ "unchecked", "rawtypes" }) |
|
|
@Override |
|
|
public List<Class<?>> getDatabaseClasses() { |
|
|
List<Class<?>> list = new ArrayList<Class<?>>(); |
|
|
|
|
|
list.add(MessageBean.class); |
|
|
list.add(ChestBean.class); |
|
|
list.add(WebUser.class); |
|
177 |
|
|
178 |
return list; |
|
|
} |
|
179 |
|
|
180 |
|
/* |
181 |
private void deprecated() { |
private void deprecated() { |
182 |
/* |
|
183 |
getCommand("stoner").setExecutor( new StonerCommand() ); |
getCommand("stoner").setExecutor( new StonerCommand() ); |
184 |
getCommand("spawn").setExecutor( new SpawnCommand() ); |
getCommand("spawn").setExecutor( new SpawnCommand() ); |
185 |
getCommand("boom").setExecutor( new BoomCommand(this) ); |
getCommand("boom").setExecutor( new BoomCommand(this) ); |
205 |
//pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this); |
//pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this); |
206 |
//pm.registerEvent(Event.Type.ENTITY_DEATH, new RespawnHandler.PlayerDeathListener(this.getDataFolder()), Priority.Normal, this); |
//pm.registerEvent(Event.Type.ENTITY_DEATH, new RespawnHandler.PlayerDeathListener(this.getDataFolder()), Priority.Normal, this); |
207 |
|
|
208 |
*/ |
|
209 |
} |
} |
210 |
|
*/ |
211 |
|
|
212 |
} |
} |