/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java
ViewVC logotype

Diff of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1935 by torben, Wed Mar 20 14:50:00 2013 UTC revision 3203 by torben, Thu Jun 1 13:16:06 2017 UTC
# Line 21  import dk.thoerup.bukkit.hoeruputils.web Line 21  import dk.thoerup.bukkit.hoeruputils.web
21  import dk.thoerup.bukkit.hoeruputils.web.StatusListener;  import dk.thoerup.bukkit.hoeruputils.web.StatusListener;
22  import dk.thoerup.bukkit.hoeruputils.web.WebUser;  import dk.thoerup.bukkit.hoeruputils.web.WebUser;
23  import dk.thoerup.bukkit.hoeruputils.web.WebUserCommand;  import dk.thoerup.bukkit.hoeruputils.web.WebUserCommand;
24    import io.ebean.Ebean;
25    
26    @SuppressWarnings("restriction")
27  public class HoerupUtilsPlugin extends JavaPlugin {  public class HoerupUtilsPlugin extends JavaPlugin {
28    
29          @Override          @Override
# Line 31  public class HoerupUtilsPlugin extends J Line 33  public class HoerupUtilsPlugin extends J
33                  }                  }
34          }          }
35                    
36          MessageWrapper messageWrapper;          MessageWrapper messageWrapper;  
37          HttpServer server = null;          HttpServer server = null;
38    
39                    
40          @Override          @Override
41          public void onEnable() {          public void onEnable() {
42                  System.out.println("Loading HoerupUtils plugin");                  System.out.println("Loading HoerupUtils plugin");
43                    
44                    Ebean.getDefaultServer();
45                    
46                  getCommand("whereis").setExecutor(new WhereisCommand(getServer()));                  getCommand("whereis").setExecutor(new WhereisCommand(getServer()));
47                  //getCommand("mapgen").setExecutor(new MapgenCommand(this));                  //getCommand("mapgen").setExecutor(new MapgenCommand(this));
48                  getCommand("eternalday").setExecutor(new EternalDayCommand(this));                  getCommand("eternalday").setExecutor(new EternalDayCommand(this));
49                  getCommand("getpos").setExecutor( new GetposCommand() );                  getCommand("getpos").setExecutor( new GetposCommand() );
50                  getCommand("msg").setExecutor( new MsgCommand( this ) );                  getCommand("msg").setExecutor( new MsgCommand( this ) );
51                  getCommand("tp").setExecutor( new TeleportCommand() );  //              getCommand("tp").setExecutor( new TeleportCommand() );
52    
53                  getCommand("wall").setExecutor( new WallCommand() );                  getCommand("wall").setExecutor( new WallCommand() );
54                  getCommand("weather").setExecutor( new WeatherCommand() );                  getCommand("weather").setExecutor( new WeatherCommand() );
# Line 65  public class HoerupUtilsPlugin extends J Line 70  public class HoerupUtilsPlugin extends J
70                  getCommand("replay").setExecutor( generalContractor );                  getCommand("replay").setExecutor( generalContractor );
71                  getCommand("levelarea").setExecutor( generalContractor );                  getCommand("levelarea").setExecutor( generalContractor );
72                  getCommand("fillarea").setExecutor( generalContractor );                  getCommand("fillarea").setExecutor( generalContractor );
73                    getCommand("levelandfillarea").setExecutor( generalContractor );
74    
75                  getCommand("slopearea").setExecutor( generalContractor );                  getCommand("slopearea").setExecutor( generalContractor );
76                  getCommand("setsurface").setExecutor( generalContractor );                  getCommand("setsurface").setExecutor( generalContractor );
77                  getCommand("platform").setExecutor( generalContractor );                  getCommand("platform").setExecutor( generalContractor );
# Line 73  public class HoerupUtilsPlugin extends J Line 80  public class HoerupUtilsPlugin extends J
80                  getCommand("spawn").setExecutor( new SpawnCommand() );                  getCommand("spawn").setExecutor( new SpawnCommand() );
81                                    
82                  getCommand("template").setExecutor( new TemplateCommand(this) );                  getCommand("template").setExecutor( new TemplateCommand(this) );
83                    getCommand("regenerate").setExecutor( new RegenerateCommand() );
84    
85    
86                  LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() );                  LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() );
87                                    
# Line 83  public class HoerupUtilsPlugin extends J Line 92  public class HoerupUtilsPlugin extends J
92                  MotdHandler motd = new MotdHandler(this);                  MotdHandler motd = new MotdHandler(this);
93                  getCommand("motd").setExecutor( motd );                  getCommand("motd").setExecutor( motd );
94                  pm.registerEvents( motd, this);                  pm.registerEvents( motd, this);
95                    
96                    WayPoint wp = new WayPoint(this);
97                    getCommand("waypoint").setExecutor( wp );
98                    getCommand("setwaypoint").setExecutor( wp );
99                    pm.registerEvents( wp, this);
100    
101    
102                  pm.registerEvents(logintimeHandler, this);                  pm.registerEvents(logintimeHandler, this);
# Line 97  public class HoerupUtilsPlugin extends J Line 111  public class HoerupUtilsPlugin extends J
111                  pm.registerEvents(jail, this);                  pm.registerEvents(jail, this);
112                  getCommand("jail").setExecutor( jail );                  getCommand("jail").setExecutor( jail );
113                                    
114                    StickyChunk chunks = new StickyChunk();
115                    pm.registerEvents(chunks, this);
116                    getCommand("stickychunk").setExecutor(chunks);          
117                                    
118                                    Mute mute = new Mute(this);
119                                    pm.registerEvents(mute, this);
120                    getCommand("mute").setExecutor(mute);
121                    getCommand("unmute").setExecutor(mute);
122                                    
123                    
124                  Runnable ddlInstaller = new Runnable() {  
125                          @Override                  messageWrapper = new MessageWrapper(this);
                         public void run() {  
                                 System.out.println("installddl");  
                                 installDDL();  
                         }  
                 };  
                 messageWrapper = new MessageWrapper(this, ddlInstaller);  
126                  pm.registerEvents( messageWrapper, this);                  pm.registerEvents( messageWrapper, this);
127                                                    
128                  AdvancedChest locked = new AdvancedChest(this, ddlInstaller);                  AdvancedChest locked = new AdvancedChest(this);
129                  getCommand("chest").setExecutor(locked);                  getCommand("chest").setExecutor(locked);
130                  pm.registerEvents( locked, this);                  pm.registerEvents( locked, this);
131                                    
132                                    
133                  getCommand("webuser").setExecutor( new WebUserCommand(this,ddlInstaller) );                                              getCommand("webuser").setExecutor( new WebUserCommand(this) );                          
134    
135                    
136                  //register web plugins                  //register web plugins
# Line 140  public class HoerupUtilsPlugin extends J Line 153  public class HoerupUtilsPlugin extends J
153                  }*/                  }*/
154                                    
155                  try  {                  try  {
156                          InetSocketAddress adr = new InetSocketAddress("localhost", 9999);                          InetSocketAddress adr = new InetSocketAddress("127.0.0.1", 9999);
157                          HttpServer.create(adr, 10);                          server = HttpServer.create(adr, 20);
158                          server.createContext("/bans", new BanListener(this, getServer()) );                          server.createContext("/bans", new BanListener(this, getServer()) );
159                          server.createContext("/webstatus", new StatusListener(this, getServer(),logintimeHandler.getConfig(), home.getConfig()) );                          server.createContext("/webstatus", new StatusListener(this, getServer(),logintimeHandler.getConfig(), home.getConfig()) );
160                                                    server.start();
161                                                    
162                  } catch(Exception e) {                  } catch(Exception e) {
163                          getLogger().log(Level.SEVERE, "Error loading webserver", e);                          getLogger().log(Level.SEVERE, "Error loading webserver", e);
# Line 167  public class HoerupUtilsPlugin extends J Line 180  public class HoerupUtilsPlugin extends J
180                  return messageWrapper;                  return messageWrapper;
181          }          }
182    
         //@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);  
183    
184                  return list;          
         }  
185    
186            /*
187          private void deprecated() {          private void deprecated() {
188  /*  
189                  getCommand("stoner").setExecutor( new StonerCommand() );                  getCommand("stoner").setExecutor( new StonerCommand() );
190                  getCommand("spawn").setExecutor( new SpawnCommand() );                  getCommand("spawn").setExecutor( new SpawnCommand() );
191                  getCommand("boom").setExecutor( new BoomCommand(this) );                  getCommand("boom").setExecutor( new BoomCommand(this) );
# Line 206  public class HoerupUtilsPlugin extends J Line 211  public class HoerupUtilsPlugin extends J
211                  //pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);                  //pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);
212                  //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);              
213    
214  */  
215          }          }
216            */
217    
218  }  }

Legend:
Removed from v.1935  
changed lines
  Added in v.3203

  ViewVC Help
Powered by ViewVC 1.1.20