/[projects]/miscJava/minecraft-plugins/hoeruputils/src/HoerupUtils.java
ViewVC logotype

Diff of /miscJava/minecraft-plugins/hoeruputils/src/HoerupUtils.java

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

revision 1177 by torben, Fri Oct 22 13:49:02 2010 UTC revision 1178 by torben, Thu Oct 28 15:58:23 2010 UTC
# Line 5  public class HoerupUtils extends Plugin Line 5  public class HoerupUtils extends Plugin
5    
6          final static Logger log = Logger.getLogger("HoerupUtils");          final static Logger log = Logger.getLogger("HoerupUtils");
7    
8            private void registerCommands() {
9                    etc e = etc.getInstance();
10                    e.addCommand("/setpos", "[x] [z] <height> - Teleports you to the given coordinates");
11                    e.addCommand("/whereis", "[player] - Tells you the position of another player");
12                    e.addCommand("/fillarea", "");
13                    e.addCommand("/levelarea", "");
14                    e.addCommand("/setsurface", "");
15            }
16                    
17          @Override          @Override
18          public void disable() {}          public void disable() {
19                    registerCommands();
20            }
21    
22          @Override          @Override
23          public void enable() {}          public void enable() {
24                    etc e = etc.getInstance();
25                    e.removeCommand("/setpos");
26                    e.removeCommand("/whereis");
27                    e.removeCommand("/fillarea");
28                    e.removeCommand("/levelarea");
29                    e.removeCommand("/setsurface");
30            }
31                    
32          @Override          @Override
33          public void initialize() {          public void initialize() {
34                  PluginLoader loader = etc.getLoader();                  PluginLoader loader = etc.getLoader();
35                  loader.addListener( PluginLoader.Hook.COMMAND, new HoerupUtilsPlugin(), this, PluginListener.Priority.MEDIUM );                  loader.addListener( PluginLoader.Hook.COMMAND, new HoerupUtilsPlugin(), this, PluginListener.Priority.MEDIUM );
36    
37                    registerCommands();
38          }          }
39    
40    
41    
42          public static class HoerupUtilsPlugin extends PluginListener {          public static class HoerupUtilsPlugin extends PluginListener {
43                  final static String USAGE = "Usage: /setpos <x> <z> [height]";                  final static String USAGE = "Usage: /setpos [x] [z] <height>";
44                  final static int BLOCK_AIR = 0; //block id = 0 is air                  final static int BLOCK_AIR = 0; //block id = 0 is air
45                  final static int BLOCK_GRASS = 2;                  final static int BLOCK_GRASS = 2;
46                  final static int BLOCK_DIRT = 3;                  final static int BLOCK_DIRT = 3;
# Line 106  public class HoerupUtils extends Plugin Line 125  public class HoerupUtils extends Plugin
125                          final int BLOCK_MAX = 86;                          final int BLOCK_MAX = 86;
126    
127                          if (split.length != 3) {                          if (split.length != 3) {
128                                  player.sendMessage("Usage /setsurface <radius> <blockID>");                                  player.sendMessage("Usage /setsurface [radius] [blockID]");
129                                  return;                                  return;
130                          }                          }
131    
# Line 167  public class HoerupUtils extends Plugin Line 186  public class HoerupUtils extends Plugin
186    
187                  private boolean validateLevelOrFill(Player player, String[] split) {                  private boolean validateLevelOrFill(Player player, String[] split) {
188                          if (split.length != 2) {                          if (split.length != 2) {
189                                  player.sendMessage("Usage: " + split[0] + " <radius>");                                  player.sendMessage("Usage: " + split[0] + " [radius]");
190                                  return false;                                  return false;
191                          }                          }
192                                                    
# Line 273  public class HoerupUtils extends Plugin Line 292  public class HoerupUtils extends Plugin
292    
293          public void whereIs(Player p1, java.lang.String[] split) {          public void whereIs(Player p1, java.lang.String[] split) {
294                  if (split.length < 2 || split.length >3) {                  if (split.length < 2 || split.length >3) {
295                          p1.sendMessage( Colors.Rose + "usage: /whereis (playername|home|warp) [warpname]" );                          p1.sendMessage( Colors.Rose + "usage: /whereis (playername|home|warp) <warpname>" );
296                          return;                          return;
297                  }                  }
298    

Legend:
Removed from v.1177  
changed lines
  Added in v.1178

  ViewVC Help
Powered by ViewVC 1.1.20