/[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 1729 by torben, Tue Mar 13 07:58:31 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    
51    
52                    LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() );
53                    
54                                    
55                  PluginManager pm = getServer().getPluginManager();                  PluginManager pm = getServer().getPluginManager();
56                  pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);  
57                  pm.registerEvent(Event.Type.ENTITY_DEATH, new RespawnHandler.PlayerDeathListener(this.getDataFolder()), Priority.Normal, this);          
58                    pm.registerEvents(logintimeHandler, this);
59                    pm.registerEvents(logintimeHandler, this);
60    
61                                    
62                    pm.registerEvents(diver, this);
63    
64    
65                    pm.registerEvents(new EndermanStopper(), this);        
66            
67            
68                  //register web plugins                  //register web plugins
69                  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);
70                  pm.registerEvent(Event.Type.CUSTOM_EVENT, new MessageListener(getServer()), Priority.Normal, this);                  //pm.registerEvent(Event.Type.CUSTOM_EVENT, new MessageListener(getServer()), Priority.Normal, this);
71    
72                    ApiBukkit api = (ApiBukkit) pm.getPlugin("ApiBukkit") ;
73                    if ( api != null) {
74                            StatusListener status = new StatusListener(this, getServer(), logintimeHandler.getConfig(), home.getConfig() );
75                            //api.setRequestController("webstatus", status );
76                            //ApiManager.getInstance().registerController( status );
77                    } else {
78                            System.out.println("Could not find ApiBukkit");
79                    }
80                    
81                    
82    
83                                    
84                    DoorBlockListener secretDoor = new DoorBlockListener(this);
85                    pm.registerEvents(secretDoor, this);
86                    pm.registerEvents(secretDoor.getPlayerListener(), this);
87                                    
88            }
89    
90            private void deprecated() {
91    /*
92                    getCommand("stoner").setExecutor( new StonerCommand() );
93                    getCommand("spawn").setExecutor( new SpawnCommand() );
94                    getCommand("boom").setExecutor( new BoomCommand(this) );
95                    getCommand("grass").setExecutor(new GrassCommand());
96    
97                    getCommand("zapme").setExecutor( new ZapmeCommand() );
98                    getCommand("zap").setExecutor( new ZapCommand() );
99    
100    
101                  PowerMiner powerMiner = new PowerMiner();                  PowerMiner powerMiner = new PowerMiner();
102                  pm.registerEvent(Event.Type.BLOCK_DAMAGE, powerMiner, Priority.Normal, this);                  pm.registerEvent(Event.Type.BLOCK_DAMAGE, powerMiner, Priority.Normal, this);
103                    pm.registerEvent(Event.Type.PLAYER_QUIT, powerMiner.getPlayerQuitListener(), Priority.Normal, this);
104                  getCommand("powerminer").setExecutor(powerMiner);                  getCommand("powerminer").setExecutor(powerMiner);
105    
106                    SuperMiner superMiner = new SuperMiner();
107                    pm.registerEvent(Event.Type.BLOCK_DAMAGE, superMiner, Priority.Normal, this);
108                    pm.registerEvent(Event.Type.PLAYER_QUIT, superMiner.getPlayerQuitListener(), Priority.Normal, this);
109                    getCommand("superminer").setExecutor(superMiner);
110    
111    
112                    //pm.registerEvent(Event.Type.PROJECTILE_HIT, new ExplosiveSnowballs(), Priority.Normal, this);
113    
114                    //pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);
115                    //pm.registerEvent(Event.Type.ENTITY_DEATH, new RespawnHandler.PlayerDeathListener(this.getDataFolder()), Priority.Normal, this);              
116    
117    */
118          }          }
119    
120  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.20