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; |
10 |
import com.sun.net.httpserver.HttpServer; |
import com.sun.net.httpserver.HttpServer; |
11 |
|
|
12 |
import dk.thoerup.bukkit.hoeruputils.chests.AdvancedChest; |
import dk.thoerup.bukkit.hoeruputils.chests.AdvancedChest; |
|
import dk.thoerup.bukkit.hoeruputils.chests.ChestBean; |
|
13 |
import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; |
import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; |
|
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.BanListener; |
import dk.thoerup.bukkit.hoeruputils.web.BanListener; |
17 |
import dk.thoerup.bukkit.hoeruputils.web.StatusListener; |
import dk.thoerup.bukkit.hoeruputils.web.StatusListener; |
|
import dk.thoerup.bukkit.hoeruputils.web.WebUser; |
|
18 |
import dk.thoerup.bukkit.hoeruputils.web.WebUserCommand; |
import dk.thoerup.bukkit.hoeruputils.web.WebUserCommand; |
19 |
|
import io.ebean.Ebean; |
20 |
|
|
21 |
|
@SuppressWarnings("restriction") |
22 |
public class HoerupUtilsPlugin extends JavaPlugin { |
public class HoerupUtilsPlugin extends JavaPlugin { |
23 |
|
|
24 |
@Override |
@Override |
28 |
} |
} |
29 |
} |
} |
30 |
|
|
31 |
MessageWrapper messageWrapper; |
MessageWrapper messageWrapper; |
32 |
HttpServer server = null; |
HttpServer server = null; |
33 |
|
|
34 |
|
|
35 |
@Override |
@Override |
36 |
public void onEnable() { |
public void onEnable() { |
37 |
System.out.println("Loading HoerupUtils plugin"); |
System.out.println("Loading HoerupUtils plugin"); |
38 |
|
|
39 |
|
Ebean.getDefaultServer(); |
40 |
|
|
41 |
getCommand("whereis").setExecutor(new WhereisCommand(getServer())); |
getCommand("whereis").setExecutor(new WhereisCommand(getServer())); |
42 |
//getCommand("mapgen").setExecutor(new MapgenCommand(this)); |
//getCommand("mapgen").setExecutor(new MapgenCommand(this)); |
43 |
getCommand("eternalday").setExecutor(new EternalDayCommand(this)); |
getCommand("eternalday").setExecutor(new EternalDayCommand(this)); |
44 |
getCommand("getpos").setExecutor( new GetposCommand() ); |
getCommand("getpos").setExecutor( new GetposCommand() ); |
45 |
getCommand("msg").setExecutor( new MsgCommand( this ) ); |
getCommand("msg").setExecutor( new MsgCommand( this ) ); |
46 |
getCommand("tp").setExecutor( new TeleportCommand() ); |
// getCommand("tp").setExecutor( new TeleportCommand() ); |
47 |
|
|
48 |
getCommand("wall").setExecutor( new WallCommand() ); |
getCommand("wall").setExecutor( new WallCommand() ); |
49 |
getCommand("weather").setExecutor( new WeatherCommand() ); |
getCommand("weather").setExecutor( new WeatherCommand() ); |
65 |
getCommand("replay").setExecutor( generalContractor ); |
getCommand("replay").setExecutor( generalContractor ); |
66 |
getCommand("levelarea").setExecutor( generalContractor ); |
getCommand("levelarea").setExecutor( generalContractor ); |
67 |
getCommand("fillarea").setExecutor( generalContractor ); |
getCommand("fillarea").setExecutor( generalContractor ); |
68 |
|
getCommand("levelandfillarea").setExecutor( generalContractor ); |
69 |
|
|
70 |
getCommand("slopearea").setExecutor( generalContractor ); |
getCommand("slopearea").setExecutor( generalContractor ); |
71 |
getCommand("setsurface").setExecutor( generalContractor ); |
getCommand("setsurface").setExecutor( generalContractor ); |
72 |
getCommand("platform").setExecutor( generalContractor ); |
getCommand("platform").setExecutor( generalContractor ); |
75 |
getCommand("spawn").setExecutor( new SpawnCommand() ); |
getCommand("spawn").setExecutor( new SpawnCommand() ); |
76 |
|
|
77 |
getCommand("template").setExecutor( new TemplateCommand(this) ); |
getCommand("template").setExecutor( new TemplateCommand(this) ); |
78 |
|
getCommand("regenerate").setExecutor( new RegenerateCommand() ); |
79 |
|
|
80 |
|
|
81 |
LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() ); |
LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() ); |
82 |
|
|
87 |
MotdHandler motd = new MotdHandler(this); |
MotdHandler motd = new MotdHandler(this); |
88 |
getCommand("motd").setExecutor( motd ); |
getCommand("motd").setExecutor( motd ); |
89 |
pm.registerEvents( motd, this); |
pm.registerEvents( motd, this); |
90 |
|
|
91 |
|
WayPoint wp = new WayPoint(this); |
92 |
|
getCommand("waypoint").setExecutor( wp ); |
93 |
|
getCommand("setwaypoint").setExecutor( wp ); |
94 |
|
pm.registerEvents( wp, this); |
95 |
|
|
96 |
|
|
97 |
pm.registerEvents(logintimeHandler, this); |
pm.registerEvents(logintimeHandler, this); |
110 |
pm.registerEvents(chunks, this); |
pm.registerEvents(chunks, this); |
111 |
getCommand("stickychunk").setExecutor(chunks); |
getCommand("stickychunk").setExecutor(chunks); |
112 |
|
|
113 |
|
Mute mute = new Mute(this); |
114 |
|
pm.registerEvents(mute, this); |
115 |
|
getCommand("mute").setExecutor(mute); |
116 |
|
getCommand("unmute").setExecutor(mute); |
117 |
|
|
118 |
|
|
119 |
Runnable ddlInstaller = new Runnable() { |
|
120 |
@Override |
messageWrapper = new MessageWrapper(this); |
|
public void run() { |
|
|
System.out.println("installddl"); |
|
|
installDDL(); |
|
|
} |
|
|
}; |
|
|
messageWrapper = new MessageWrapper(this, ddlInstaller); |
|
121 |
pm.registerEvents( messageWrapper, this); |
pm.registerEvents( messageWrapper, this); |
122 |
|
|
123 |
AdvancedChest locked = new AdvancedChest(this, ddlInstaller); |
AdvancedChest locked = new AdvancedChest(this); |
124 |
getCommand("chest").setExecutor(locked); |
getCommand("chest").setExecutor(locked); |
125 |
pm.registerEvents( locked, this); |
pm.registerEvents( locked, this); |
126 |
|
|
127 |
|
|
128 |
getCommand("webuser").setExecutor( new WebUserCommand(this,ddlInstaller) ); |
getCommand("webuser").setExecutor( new WebUserCommand(this) ); |
129 |
|
|
130 |
|
|
131 |
//register web plugins |
//register web plugins |
175 |
return messageWrapper; |
return messageWrapper; |
176 |
} |
} |
177 |
|
|
|
//@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); |
|
178 |
|
|
179 |
return list; |
|
|
} |
|
180 |
|
|
181 |
|
/* |
182 |
private void deprecated() { |
private void deprecated() { |
183 |
/* |
|
184 |
getCommand("stoner").setExecutor( new StonerCommand() ); |
getCommand("stoner").setExecutor( new StonerCommand() ); |
185 |
getCommand("spawn").setExecutor( new SpawnCommand() ); |
getCommand("spawn").setExecutor( new SpawnCommand() ); |
186 |
getCommand("boom").setExecutor( new BoomCommand(this) ); |
getCommand("boom").setExecutor( new BoomCommand(this) ); |
206 |
//pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this); |
//pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this); |
207 |
//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); |
208 |
|
|
209 |
*/ |
|
210 |
} |
} |
211 |
|
*/ |
212 |
|
|
213 |
} |
} |