/[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 1936 by torben, Wed Mar 20 14:56:43 2013 UTC revision 3220 by torben, Sat Jan 6 14:41:35 2018 UTC
# Line 2  package dk.thoerup.bukkit.hoeruputils; Line 2  package dk.thoerup.bukkit.hoeruputils;
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;
# Line 11  import org.bukkit.plugin.java.JavaPlugin Line 9  import org.bukkit.plugin.java.JavaPlugin
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;
13  import dk.thoerup.bukkit.hoeruputils.message.MessageBean;  import dk.thoerup.bukkit.hoeruputils.deprecated.ExplosiveSnowballs;
14  import dk.thoerup.bukkit.hoeruputils.message.MessageWrapper;  import dk.thoerup.bukkit.hoeruputils.deprecated.ZapCommand;
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;  
 import dk.thoerup.bukkit.hoeruputils.web.WebUserCommand;  
18    
19    @SuppressWarnings("restriction")
20  public class HoerupUtilsPlugin extends JavaPlugin {  public class HoerupUtilsPlugin extends JavaPlugin {
21    
22          @Override          @Override
# Line 31  public class HoerupUtilsPlugin extends J Line 26  public class HoerupUtilsPlugin extends J
26                  }                  }
27          }          }
28                    
29          MessageWrapper messageWrapper;          //MessageWrapper messageWrapper;        //TODO: RE-ENABLE
30          HttpServer server = null;          HttpServer server = null;
31    
32                    
33          @Override          @Override
34          public void onEnable() {          public void onEnable() {
35                  System.out.println("Loading HoerupUtils plugin");                  System.out.println("Loading HoerupUtils plugin");
36                    
37                    //Ebean.getDefaultServer(); //TODO: RE-ENABLE
38                    
39                  getCommand("whereis").setExecutor(new WhereisCommand(getServer()));                  getCommand("whereis").setExecutor(new WhereisCommand(getServer()));
40                  //getCommand("mapgen").setExecutor(new MapgenCommand(this));                  //getCommand("mapgen").setExecutor(new MapgenCommand(this));
41                  getCommand("eternalday").setExecutor(new EternalDayCommand(this));                  getCommand("eternalday").setExecutor(new EternalDayCommand(this));
42                  getCommand("getpos").setExecutor( new GetposCommand() );                  getCommand("getpos").setExecutor( new GetposCommand() );
43                  getCommand("msg").setExecutor( new MsgCommand( this ) );                  getCommand("msg").setExecutor( new MsgCommand( this ) );
44                  getCommand("tp").setExecutor( new TeleportCommand() );  //              getCommand("tp").setExecutor( new TeleportCommand() );
45    
46                  getCommand("wall").setExecutor( new WallCommand() );                  getCommand("wall").setExecutor( new WallCommand() );
47                  getCommand("weather").setExecutor( new WeatherCommand() );                  getCommand("weather").setExecutor( new WeatherCommand() );
# Line 65  public class HoerupUtilsPlugin extends J Line 63  public class HoerupUtilsPlugin extends J
63                  getCommand("replay").setExecutor( generalContractor );                  getCommand("replay").setExecutor( generalContractor );
64                  getCommand("levelarea").setExecutor( generalContractor );                  getCommand("levelarea").setExecutor( generalContractor );
65                  getCommand("fillarea").setExecutor( generalContractor );                  getCommand("fillarea").setExecutor( generalContractor );
66                    getCommand("levelandfillarea").setExecutor( generalContractor );
67    
68                  getCommand("slopearea").setExecutor( generalContractor );                  getCommand("slopearea").setExecutor( generalContractor );
69                  getCommand("setsurface").setExecutor( generalContractor );                  getCommand("setsurface").setExecutor( generalContractor );
70                  getCommand("platform").setExecutor( generalContractor );                  getCommand("platform").setExecutor( generalContractor );
# Line 73  public class HoerupUtilsPlugin extends J Line 73  public class HoerupUtilsPlugin extends J
73                  getCommand("spawn").setExecutor( new SpawnCommand() );                  getCommand("spawn").setExecutor( new SpawnCommand() );
74                                    
75                  getCommand("template").setExecutor( new TemplateCommand(this) );                  getCommand("template").setExecutor( new TemplateCommand(this) );
76                    getCommand("regenerate").setExecutor( new RegenerateCommand() );
77    
78    
79                  LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() );                  LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() );
80                                    
# Line 83  public class HoerupUtilsPlugin extends J Line 85  public class HoerupUtilsPlugin extends J
85                  MotdHandler motd = new MotdHandler(this);                  MotdHandler motd = new MotdHandler(this);
86                  getCommand("motd").setExecutor( motd );                  getCommand("motd").setExecutor( motd );
87                  pm.registerEvents( motd, this);                  pm.registerEvents( motd, this);
88                    
89                    WayPoint wp = new WayPoint(this);
90                    getCommand("waypoint").setExecutor( wp );
91                    getCommand("setwaypoint").setExecutor( wp );
92                    pm.registerEvents( wp, this);
93    
94    
95                  pm.registerEvents(logintimeHandler, this);                  pm.registerEvents(logintimeHandler, this);
96                  pm.registerEvents(logintimeHandler, this);                  pm.registerEvents(logintimeHandler, this);
97    
98                                    
99                    
100                  pm.registerEvents(diver, this);                  pm.registerEvents(diver, this);
101    
102                  pm.registerEvents(new EndermanStopper(), this);                  pm.registerEvents(new EndermanStopper(), this);
# Line 97  public class HoerupUtilsPlugin extends J Line 105  public class HoerupUtilsPlugin extends J
105                  pm.registerEvents(jail, this);                  pm.registerEvents(jail, this);
106                  getCommand("jail").setExecutor( jail );                  getCommand("jail").setExecutor( jail );
107                                    
108                    StickyChunk chunks = new StickyChunk();
109                    pm.registerEvents(chunks, this);
110                    getCommand("stickychunk").setExecutor(chunks);          
111                    
112                    Mute mute = new Mute(this);
113                    pm.registerEvents(mute, this);
114                    getCommand("mute").setExecutor(mute);
115                    getCommand("unmute").setExecutor(mute);
116                                    
117                                    
118                                    // - fun/crazy/party elements
119                                    pm.registerEvents(new ExplosiveSnowballs(), this);
120                    getCommand("zap").setExecutor( new ZapCommand() );
121                    
122                  Runnable ddlInstaller = new Runnable() {  /*
123                          @Override   * //TODO: RE-ENABLE
124                          public void run() {                  messageWrapper = new MessageWrapper(this);
                                 System.out.println("installddl");  
                                 installDDL();  
                         }  
                 };  
                 messageWrapper = new MessageWrapper(this, ddlInstaller);  
125                  pm.registerEvents( messageWrapper, this);                  pm.registerEvents( messageWrapper, this);
126                                                    
127                  AdvancedChest locked = new AdvancedChest(this, ddlInstaller);                  AdvancedChest locked = new AdvancedChest(this);
128                  getCommand("chest").setExecutor(locked);                  getCommand("chest").setExecutor(locked);
129                  pm.registerEvents( locked, this);                  pm.registerEvents( locked, this);
130                                    
131                                    
132                  getCommand("webuser").setExecutor( new WebUserCommand(this,ddlInstaller) );                                              getCommand("webuser").setExecutor( new WebUserCommand(this) );                          
133    */
134                    
135                  //register web plugins                  //register web plugins
136                  //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);
# Line 140  public class HoerupUtilsPlugin extends J Line 152  public class HoerupUtilsPlugin extends J
152                  }*/                  }*/
153                                    
154                  try  {                  try  {
155                          InetSocketAddress adr = new InetSocketAddress("localhost", 9999);                          InetSocketAddress adr = new InetSocketAddress("127.0.0.1", 9999);
156                          HttpServer.create(adr, 10);                          server = HttpServer.create(adr, 20);
157                          server.createContext("/bans", new BanListener(this, getServer()) );                          server.createContext("/bans", new BanListener(this, getServer()) );
158                          server.createContext("/webstatus", new StatusListener(this, getServer(),logintimeHandler.getConfig(), home.getConfig()) );                          server.createContext("/webstatus", new StatusListener(this, getServer(),logintimeHandler.getConfig(), home.getConfig()) );
159                          server.start();                          server.start();
# Line 162  public class HoerupUtilsPlugin extends J Line 174  public class HoerupUtilsPlugin extends J
174                    
175                    
176                    
177                    /*
178             * //TODO: RE-ENABLE
179          public MessageWrapper getMessageWrapper() {          public MessageWrapper getMessageWrapper() {
180                  return messageWrapper;                  return messageWrapper;
181          }          }
182            */
183    
         //@SuppressWarnings({ "unchecked", "rawtypes" })  
         @Override  
         public List<Class<?>> getDatabaseClasses() {  
                 List<Class<?>> list = new ArrayList<Class<?>>();  
184    
185                  list.add(MessageBean.class);          
                 list.add(ChestBean.class);  
                 list.add(WebUser.class);  
   
                 return list;  
         }  
186    
187            /*
188          private void deprecated() {          private void deprecated() {
189  /*  
190                  getCommand("stoner").setExecutor( new StonerCommand() );                  getCommand("stoner").setExecutor( new StonerCommand() );
191                  getCommand("spawn").setExecutor( new SpawnCommand() );                  getCommand("spawn").setExecutor( new SpawnCommand() );
192                  getCommand("boom").setExecutor( new BoomCommand(this) );                  getCommand("boom").setExecutor( new BoomCommand(this) );
# Line 206  public class HoerupUtilsPlugin extends J Line 212  public class HoerupUtilsPlugin extends J
212                  //pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);                  //pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);
213                  //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);              
214    
215  */  
216          }          }
217            */
218    
219  }  }

Legend:
Removed from v.1936  
changed lines
  Added in v.3220

  ViewVC Help
Powered by ViewVC 1.1.20