/[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 1465 by torben, Wed May 18 18:13:55 2011 UTC revision 1673 by torben, Fri Dec 23 10:27:05 2011 UTC
# Line 6  import org.bukkit.event.Event.Priority; Line 6  import org.bukkit.event.Event.Priority;
6  import org.bukkit.plugin.PluginManager;  import org.bukkit.plugin.PluginManager;
7  import org.bukkit.plugin.java.JavaPlugin;  import org.bukkit.plugin.java.JavaPlugin;
8    
9    
10    import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener;
11  import dk.thoerup.bukkit.hoeruputils.web.MessageListener;  import dk.thoerup.bukkit.hoeruputils.web.MessageListener;
12  import dk.thoerup.bukkit.hoeruputils.web.StatusListener;  import dk.thoerup.bukkit.hoeruputils.web.StatusListener;
13    
# Line 21  public class HoerupUtilsPlugin extends J Line 23  public class HoerupUtilsPlugin extends J
23          public void onEnable() {          public void onEnable() {
24                  System.out.println("Loading HoerupUtils plugin");                  System.out.println("Loading HoerupUtils plugin");
25                  getCommand("whereis").setExecutor(new WhereisCommand(getServer()));                  getCommand("whereis").setExecutor(new WhereisCommand(getServer()));
26                  getCommand("mapgen").setExecutor(new MapgenCommand(this));                  //getCommand("mapgen").setExecutor(new MapgenCommand(this));
27                  getCommand("eternalday").setExecutor(new EternalDayCommand(this));                  getCommand("eternalday").setExecutor(new EternalDayCommand(this));
28                  getCommand("grass").setExecutor(new GrassCommand());                  getCommand("getpos").setExecutor( new GetposCommand() );
29                    getCommand("msg").setExecutor( new MsgCommand( getServer() ) );
30                    getCommand("tp").setExecutor( new TeleportCommand() );
31    
32                    getCommand("wall").setExecutor( new WallCommand() );
33                    getCommand("weather").setExecutor( new WeatherCommand() );
34    
35                    getCommand("gc").setExecutor( new GcCommand() );
36    
37    
38                    HomeCommand home = new HomeCommand(this);
39                    getCommand("home").setExecutor( home );
40                    getCommand("sethome").setExecutor( home );
41    
42                    DiverCommand diver = new DiverCommand(this );
43                    getCommand("diver").setExecutor( diver );
44    
45    
46                    LogintimeHandler logintimeHandler = new LogintimeHandler( this.getDataFolder() );
47                    
48                                    
49                  PluginManager pm = getServer().getPluginManager();                  PluginManager pm = getServer().getPluginManager();
50                  pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);                  //pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);
51                  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);              
52    
53    
54                    pm.registerEvent(Event.Type.PLAYER_LOGIN, logintimeHandler, Priority.Normal, this);
55                    pm.registerEvent(Event.Type.PLAYER_QUIT, logintimeHandler, Priority.Normal, this);
56    
57                                    
58                    pm.registerEvent(Event.Type.PLAYER_QUIT, diver.getQuitHandler(), Priority.Normal, this);
59    
60    
61                    pm.registerEvent(Event.Type.ENDERMAN_PICKUP, new EndermanStopper(), Priority.Normal, this);            
62            
63            
64                  //register web plugins                  //register web plugins
65                  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);
66                  pm.registerEvent(Event.Type.CUSTOM_EVENT, new MessageListener(getServer()), Priority.Normal, this);                  pm.registerEvent(Event.Type.CUSTOM_EVENT, new MessageListener(getServer()), Priority.Normal, this);
67                                    
68                                    
69    
70    
71    
72    
73    
74                    
75                    DoorBlockListener secretDoor = new DoorBlockListener(this);
76                    pm.registerEvent(Event.Type.BLOCK_BREAK, secretDoor, Priority.Normal, this);
77                    pm.registerEvent(Event.Type.SIGN_CHANGE, secretDoor, Priority.Normal, this);
78                    pm.registerEvent(Event.Type.REDSTONE_CHANGE, secretDoor, Priority.Normal, this);
79                    pm.registerEvent(Event.Type.PLAYER_INTERACT, secretDoor.getPlayerListener(), Priority.Normal, this);
80                    
81            }
82    
83            private void deprecated() {
84    /*
85                    getCommand("stoner").setExecutor( new StonerCommand() );
86                    getCommand("spawn").setExecutor( new SpawnCommand() );
87                    getCommand("boom").setExecutor( new BoomCommand(this) );
88                    getCommand("grass").setExecutor(new GrassCommand());
89    
90                    getCommand("zapme").setExecutor( new ZapmeCommand() );
91                    getCommand("zap").setExecutor( new ZapCommand() );
92    
93    
94                  PowerMiner powerMiner = new PowerMiner();                  PowerMiner powerMiner = new PowerMiner();
95                  pm.registerEvent(Event.Type.BLOCK_DAMAGE, powerMiner, Priority.Normal, this);                  pm.registerEvent(Event.Type.BLOCK_DAMAGE, powerMiner, Priority.Normal, this);
96                  pm.registerEvent(Event.Type.PLAYER_QUIT, powerMiner.getPlayerQuitListener(), Priority.Normal, this);                  pm.registerEvent(Event.Type.PLAYER_QUIT, powerMiner.getPlayerQuitListener(), Priority.Normal, this);
97                  getCommand("powerminer").setExecutor(powerMiner);                  getCommand("powerminer").setExecutor(powerMiner);
98    
99                    SuperMiner superMiner = new SuperMiner();
100                    pm.registerEvent(Event.Type.BLOCK_DAMAGE, superMiner, Priority.Normal, this);
101                    pm.registerEvent(Event.Type.PLAYER_QUIT, superMiner.getPlayerQuitListener(), Priority.Normal, this);
102                    getCommand("superminer").setExecutor(superMiner);
103    
104    
105                    //pm.registerEvent(Event.Type.PROJECTILE_HIT, new ExplosiveSnowballs(), Priority.Normal, this);
106    
107    */
108          }          }
109    
110  }  }

Legend:
Removed from v.1465  
changed lines
  Added in v.1673

  ViewVC Help
Powered by ViewVC 1.1.20