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

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

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

revision 1856 by torben, Sun Oct 14 11:36:45 2012 UTC revision 1857 by torben, Sun Oct 14 11:48:43 2012 UTC
# Line 42  public class Jail implements CommandExec Line 42  public class Jail implements CommandExec
42                  jailed.add("hoerup");                  jailed.add("hoerup");
43          }          }
44    
45            public void save() {
46            }
47    
48          @Override          @Override
49          public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {          public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {
50                  if (! (sender instanceof Player) ) {                  if (! (sender instanceof Player) ) {
# Line 57  public class Jail implements CommandExec Line 60  public class Jail implements CommandExec
60                  }                  }
61    
62                  if (args.length == 0) {                  if (args.length == 0) {
63                          p.sendMessage("Usage: /jail <imprison|release|list|tpjail|tprelease>");                          p.sendMessage("Usage: /jail <imprison|release|list|tpjail|tprelease|setjail|setrelease>");
64                          return true;                          return true;
65                  }                  }
66    
# Line 76  public class Jail implements CommandExec Line 79  public class Jail implements CommandExec
79                          inmate.sendMessage("You have been imprisoned");                          inmate.sendMessage("You have been imprisoned");
80                          inmate.teleport( jailLocation );                          inmate.teleport( jailLocation );
81                          jailed.add( inmate.getName() );                          jailed.add( inmate.getName() );
82                            save();
83                          return true;                          return true;
84                  }                  }
85    
# Line 94  public class Jail implements CommandExec Line 98  public class Jail implements CommandExec
98                          jailed.remove( inmate.getName() );                          jailed.remove( inmate.getName() );
99                          inmate.sendMessage("You have been released from prison");                          inmate.sendMessage("You have been released from prison");
100                          inmate.teleport( releaseLocation );                          inmate.teleport( releaseLocation );
101                            save();
102                          return true;                          return true;
103                  }                  }
104    
# Line 110  public class Jail implements CommandExec Line 115  public class Jail implements CommandExec
115                          }                          }
116                          return true;                          return true;
117                  }                  }
118    
119                    if (args[0].equals("setjail")) {
120                            jailLocation = p.getLocation().clone();
121                            p.sendMessage("New jail location has been set");
122                            save();
123                            return true;
124                    }
125                    if (args[0].equals("setrelease")) {
126                            releaseLocation = p.getLocation().clone();
127                            p.sendMessage("New release location has been set");
128                            save();
129                            return true;
130                    }
131    
132                  if (args[0].equals("tpjail")) {                  if (args[0].equals("tpjail")) {
133                          p.teleport(jailLocation);                          p.teleport(jailLocation);
134                          return true;                          return true;
# Line 144  public class Jail implements CommandExec Line 163  public class Jail implements CommandExec
163                  Player p = event.getPlayer();                  Player p = event.getPlayer();
164                  if (jailed.contains( p.getName() ) ) {                  if (jailed.contains( p.getName() ) ) {
165                          p.teleport( jailLocation );                          p.teleport( jailLocation );
166                            p.sendMessage("You are currently in jail and have been teleported to you cell");
167                  }                  }
168          }          }
169    

Legend:
Removed from v.1856  
changed lines
  Added in v.1857

  ViewVC Help
Powered by ViewVC 1.1.20