/[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

miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java revision 1385 by torben, Sun Apr 24 10:23:02 2011 UTC miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java revision 1739 by torben, Sun Mar 18 10:35:28 2012 UTC
# Line 1  Line 1 
1  package dk.thoerup.bukkit.hoeruputils;  package dk.thoerup.bukkit.hoeruputils;
2    
3    
 import org.bukkit.event.Event;  
 import org.bukkit.event.Event.Priority;  
4  import org.bukkit.plugin.PluginManager;  import org.bukkit.plugin.PluginManager;
5  import org.bukkit.plugin.java.JavaPlugin;  import org.bukkit.plugin.java.JavaPlugin;
6    
7  import dk.thoerup.bukkit.hoeruputils.web.MessageListener;  import de.codeinfection.quickwango.ApiBukkit.ApiBukkit;
8    import de.codeinfection.quickwango.ApiBukkit.ApiServer.ApiManager;
9    import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands;
10    import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener;
11  import dk.thoerup.bukkit.hoeruputils.web.StatusListener;  import dk.thoerup.bukkit.hoeruputils.web.StatusListener;
12    
13  public class HoerupUtilsPlugin extends JavaPlugin {  public class HoerupUtilsPlugin extends JavaPlugin {
# Line 21  public class HoerupUtilsPlugin extends J Line 22  public class HoerupUtilsPlugin extends J
22          public void onEnable() {          public void onEnable() {
23                  System.out.println("Loading HoerupUtils plugin");                  System.out.println("Loading HoerupUtils plugin");
24                  getCommand("whereis").setExecutor(new WhereisCommand(getServer()));                  getCommand("whereis").setExecutor(new WhereisCommand(getServer()));
25                  getCommand("mapgen").setExecutor(new MapgenCommand(this));                  //getCommand("mapgen").setExecutor(new MapgenCommand(this));
26                  getCommand("eternalday").setExecutor(new EternalDayCommand(this));                  getCommand("eternalday").setExecutor(new EternalDayCommand(this));
27                    getCommand("getpos").setExecutor( new GetposCommand() );
28                    getCommand("msg").setExecutor( new MsgCommand( getServer() ) );
29                    getCommand("tp").setExecutor( new TeleportCommand() );
30    
31                    getCommand("wall").setExecutor( new WallCommand() );
32                    getCommand("weather").setExecutor( new WeatherCommand() );
33    
34                    getCommand("gc").setExecutor( new GcCommand() );
35    
36    
37                    HomeCommand home = new HomeCommand(this);
38                    getCommand("home").setExecutor( home );
39                    getCommand("sethome").setExecutor( home );
40    
41                    DiverCommand diver = new DiverCommand(this );
42                    getCommand("diver").setExecutor( diver );
43                    
44                    GeneralContractorCommands generalContractor = new GeneralContractorCommands();
45                    getCommand("replay").setExecutor( generalContractor );
46                    getCommand("levelarea").setExecutor( generalContractor );
47                    getCommand("fillarea").setExecutor( generalContractor );
48                    getCommand("slopearea").setExecutor( generalContractor );
49                    getCommand("setsurface").setExecutor( generalContractor );
50                    getCommand("platform").setExecutor( generalContractor );
51                    getCommand("cylinder").setExecutor( generalContractor );
52    
53                    
54                    getCommand("template").setExecutor( new TemplateCommand(this) );
55    
56                    LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() );
57                    
58                                    
59                  PluginManager pm = getServer().getPluginManager();                  PluginManager pm = getServer().getPluginManager();
60                  pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);  
61                  pm.registerEvent(Event.Type.ENTITY_DEATH, new RespawnHandler.PlayerDeathListener(this.getDataFolder()), Priority.Normal, this);          
62                    pm.registerEvents(logintimeHandler, this);
63                    pm.registerEvents(logintimeHandler, this);
64    
65                                    
66                    pm.registerEvents(diver, this);
67    
68    
69                    pm.registerEvents(new EndermanStopper(), this);        
70            
71            
72                  //register web plugins                  //register web plugins
73                  pm.registerEvent(Event.Type.CUSTOM_EVENT, new StatusListener(getServer()), Priority.Normal, this);                  //pm.registerEvent(Event.Type.CUSTOM_EVENT, new StatusListener(getServer(), logintimeHandler.getConfig(), home.getConfig() ), Priority.Normal, this);
74                  pm.registerEvent(Event.Type.CUSTOM_EVENT, new MessageListener(getServer()), Priority.Normal, this);                  //pm.registerEvent(Event.Type.CUSTOM_EVENT, new MessageListener(getServer()), Priority.Normal, this);
75    
76                    ApiBukkit api = (ApiBukkit) pm.getPlugin("ApiBukkit") ;
77                    if ( api != null) {
78                            StatusListener status = new StatusListener(this, getServer(), logintimeHandler.getConfig(), home.getConfig() );
79                            //api.setRequestController("webstatus", status );
80                            ApiManager.getInstance().registerController( status );
81                    } else {
82                            System.out.println("Could not find ApiBukkit");
83                    }
84                    
85                    
86    
87                                    
88                    DoorBlockListener secretDoor = new DoorBlockListener(this);
89                    pm.registerEvents(secretDoor, this);
90                    pm.registerEvents(secretDoor.getPlayerListener(), this);
91                                    
92            }
93    
94            private void deprecated() {
95    /*
96                    getCommand("stoner").setExecutor( new StonerCommand() );
97                    getCommand("spawn").setExecutor( new SpawnCommand() );
98                    getCommand("boom").setExecutor( new BoomCommand(this) );
99                    getCommand("grass").setExecutor(new GrassCommand());
100    
101                    getCommand("zapme").setExecutor( new ZapmeCommand() );
102                    getCommand("zap").setExecutor( new ZapCommand() );
103    
104    
105                  PowerMiner powerMiner = new PowerMiner();                  PowerMiner powerMiner = new PowerMiner();
106                  pm.registerEvent(Event.Type.BLOCK_DAMAGE, powerMiner, Priority.Normal, this);                  pm.registerEvent(Event.Type.BLOCK_DAMAGE, powerMiner, Priority.Normal, this);
107                    pm.registerEvent(Event.Type.PLAYER_QUIT, powerMiner.getPlayerQuitListener(), Priority.Normal, this);
108                  getCommand("powerminer").setExecutor(powerMiner);                  getCommand("powerminer").setExecutor(powerMiner);
109    
110                    SuperMiner superMiner = new SuperMiner();
111                    pm.registerEvent(Event.Type.BLOCK_DAMAGE, superMiner, Priority.Normal, this);
112                    pm.registerEvent(Event.Type.PLAYER_QUIT, superMiner.getPlayerQuitListener(), Priority.Normal, this);
113                    getCommand("superminer").setExecutor(superMiner);
114    
115    
116                    //pm.registerEvent(Event.Type.PROJECTILE_HIT, new ExplosiveSnowballs(), Priority.Normal, this);
117    
118                    //pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);
119                    //pm.registerEvent(Event.Type.ENTITY_DEATH, new RespawnHandler.PlayerDeathListener(this.getDataFolder()), Priority.Normal, this);              
120    
121    */
122          }          }
123    
124  }  }

Legend:
Removed from v.1385  
changed lines
  Added in v.1739

  ViewVC Help
Powered by ViewVC 1.1.20