--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java 2013/03/20 21:08:46 1942 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java 2017/06/01 13:18:05 3204 @@ -2,8 +2,6 @@ import java.net.InetSocketAddress; -import java.util.ArrayList; -import java.util.List; import java.util.logging.Level; import org.bukkit.plugin.PluginManager; @@ -12,16 +10,15 @@ import com.sun.net.httpserver.HttpServer; import dk.thoerup.bukkit.hoeruputils.chests.AdvancedChest; -import dk.thoerup.bukkit.hoeruputils.chests.ChestBean; import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands; -import dk.thoerup.bukkit.hoeruputils.message.MessageBean; import dk.thoerup.bukkit.hoeruputils.message.MessageWrapper; import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener; import dk.thoerup.bukkit.hoeruputils.web.BanListener; import dk.thoerup.bukkit.hoeruputils.web.StatusListener; -import dk.thoerup.bukkit.hoeruputils.web.WebUser; import dk.thoerup.bukkit.hoeruputils.web.WebUserCommand; +import io.ebean.Ebean; +@SuppressWarnings("restriction") public class HoerupUtilsPlugin extends JavaPlugin { @Override @@ -31,19 +28,22 @@ } } - MessageWrapper messageWrapper; + MessageWrapper messageWrapper; HttpServer server = null; @Override public void onEnable() { System.out.println("Loading HoerupUtils plugin"); + + Ebean.getDefaultServer(); + getCommand("whereis").setExecutor(new WhereisCommand(getServer())); //getCommand("mapgen").setExecutor(new MapgenCommand(this)); getCommand("eternalday").setExecutor(new EternalDayCommand(this)); getCommand("getpos").setExecutor( new GetposCommand() ); getCommand("msg").setExecutor( new MsgCommand( this ) ); - getCommand("tp").setExecutor( new TeleportCommand() ); +// getCommand("tp").setExecutor( new TeleportCommand() ); getCommand("wall").setExecutor( new WallCommand() ); getCommand("weather").setExecutor( new WeatherCommand() ); @@ -65,6 +65,8 @@ getCommand("replay").setExecutor( generalContractor ); getCommand("levelarea").setExecutor( generalContractor ); getCommand("fillarea").setExecutor( generalContractor ); + getCommand("levelandfillarea").setExecutor( generalContractor ); + getCommand("slopearea").setExecutor( generalContractor ); getCommand("setsurface").setExecutor( generalContractor ); getCommand("platform").setExecutor( generalContractor ); @@ -73,6 +75,8 @@ getCommand("spawn").setExecutor( new SpawnCommand() ); getCommand("template").setExecutor( new TemplateCommand(this) ); + getCommand("regenerate").setExecutor( new RegenerateCommand() ); + LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() ); @@ -83,6 +87,11 @@ MotdHandler motd = new MotdHandler(this); getCommand("motd").setExecutor( motd ); pm.registerEvents( motd, this); + + WayPoint wp = new WayPoint(this); + getCommand("waypoint").setExecutor( wp ); + getCommand("setwaypoint").setExecutor( wp ); + pm.registerEvents( wp, this); pm.registerEvents(logintimeHandler, this); @@ -101,24 +110,22 @@ pm.registerEvents(chunks, this); getCommand("stickychunk").setExecutor(chunks); + Mute mute = new Mute(this); + pm.registerEvents(mute, this); + getCommand("mute").setExecutor(mute); + getCommand("unmute").setExecutor(mute); - Runnable ddlInstaller = new Runnable() { - @Override - public void run() { - System.out.println("installddl"); - installDDL(); - } - }; - messageWrapper = new MessageWrapper(this, ddlInstaller); + + messageWrapper = new MessageWrapper(this); pm.registerEvents( messageWrapper, this); - AdvancedChest locked = new AdvancedChest(this, ddlInstaller); + AdvancedChest locked = new AdvancedChest(this); getCommand("chest").setExecutor(locked); pm.registerEvents( locked, this); - getCommand("webuser").setExecutor( new WebUserCommand(this,ddlInstaller) ); + getCommand("webuser").setExecutor( new WebUserCommand(this) ); //register web plugins @@ -168,20 +175,12 @@ return messageWrapper; } - //@SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public List> getDatabaseClasses() { - List> list = new ArrayList>(); - - list.add(MessageBean.class); - list.add(ChestBean.class); - list.add(WebUser.class); - return list; - } + + /* private void deprecated() { -/* + getCommand("stoner").setExecutor( new StonerCommand() ); getCommand("spawn").setExecutor( new SpawnCommand() ); getCommand("boom").setExecutor( new BoomCommand(this) ); @@ -207,7 +206,8 @@ //pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this); //pm.registerEvent(Event.Type.ENTITY_DEATH, new RespawnHandler.PlayerDeathListener(this.getDataFolder()), Priority.Normal, this); -*/ + } + */ }