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

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

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

revision 1239 by torben, Tue Mar 22 19:09:40 2011 UTC revision 1590 by torben, Tue Aug 16 16:04:01 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    import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener;
10    import dk.thoerup.bukkit.hoeruputils.web.MessageListener;
11    import dk.thoerup.bukkit.hoeruputils.web.StatusListener;
12    
13  public class HoerupUtilsPlugin extends JavaPlugin {  public class HoerupUtilsPlugin extends JavaPlugin {
14    
15          @Override          @Override
# Line 18  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));
26                    getCommand("eternalday").setExecutor(new EternalDayCommand(this));
27                    getCommand("grass").setExecutor(new GrassCommand());
28                    getCommand("getpos").setExecutor( new GetposCommand() );
29                    getCommand("zapme").setExecutor( new ZapmeCommand() );
30                    getCommand("zap").setExecutor( new ZapCommand() );
31                    getCommand("msg").setExecutor( new MsgCommand( getServer() ) );
32                    getCommand("stoner").setExecutor( new StonerCommand() );
33                    getCommand("boom").setExecutor( new BoomCommand(this) );
34                    getCommand("spawn").setExecutor( new SpawnCommand() );
35                    getCommand("tp").setExecutor( new TeleportCommand() );
36    
37                    getCommand("wall").setExecutor( new WallCommand() );
38                                    
39                  PluginManager pm = getServer().getPluginManager();                  PluginManager pm = getServer().getPluginManager();
40                  pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);                  pm.registerEvent(Event.Type.PLAYER_RESPAWN, new RespawnHandler(this), Priority.Normal, this);
41                  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);        
42                    
43                    //register web plugins
44                    pm.registerEvent(Event.Type.CUSTOM_EVENT, new StatusListener(getServer()), Priority.Normal, this);
45                    pm.registerEvent(Event.Type.CUSTOM_EVENT, new MessageListener(getServer()), Priority.Normal, this);
46                    
47                    
48                    PowerMiner powerMiner = new PowerMiner();
49                    pm.registerEvent(Event.Type.BLOCK_DAMAGE, powerMiner, Priority.Normal, this);
50                    pm.registerEvent(Event.Type.PLAYER_QUIT, powerMiner.getPlayerQuitListener(), Priority.Normal, this);
51                    getCommand("powerminer").setExecutor(powerMiner);
52    
53    
54                    SuperMiner superMiner = new SuperMiner();
55                    pm.registerEvent(Event.Type.BLOCK_DAMAGE, superMiner, Priority.Normal, this);
56                    pm.registerEvent(Event.Type.PLAYER_QUIT, superMiner.getPlayerQuitListener(), Priority.Normal, this);
57                    getCommand("superminer").setExecutor(superMiner);
58    
59                    pm.registerEvent(Event.Type.PROJECTILE_HIT, new ExplosiveSnowballs(), Priority.Normal, this);
60    
61                    
62                    DoorBlockListener secretDoor = new DoorBlockListener(this);
63                    pm.registerEvent(Event.Type.BLOCK_BREAK, secretDoor, Priority.Normal, this);
64                    pm.registerEvent(Event.Type.SIGN_CHANGE, secretDoor, Priority.Normal, this);
65                    pm.registerEvent(Event.Type.REDSTONE_CHANGE, secretDoor, Priority.Normal, this);
66                    pm.registerEvent(Event.Type.PLAYER_INTERACT, secretDoor.getPlayerListener(), Priority.Normal, this);
67                                    
                 this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new PeriodicStatusSaver(getServer()), 10*20, 2*60*20);  
68          }          }
69    
70  }  }

Legend:
Removed from v.1239  
changed lines
  Added in v.1590

  ViewVC Help
Powered by ViewVC 1.1.20