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

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

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

revision 1874 by torben, Tue Nov 27 15:38:11 2012 UTC revision 1916 by torben, Fri Jan 18 09:44:30 2013 UTC
# Line 148  public class AdvancedChest  implements L Line 148  public class AdvancedChest  implements L
148                                  player.sendMessage("This chest is not protected");                                  player.sendMessage("This chest is not protected");
149                                  return true;                                  return true;
150                          }                          }
151                          if (! chest.getOwner().equals( player.getName() ) ) {                          if ( chest.getOwner().equals( player.getName() ) || player.isOp() ) {
152                                    //do nothing
153                            } else {
154                                  player.sendMessage("You can not remove lock from a chest you don't own");                                  player.sendMessage("You can not remove lock from a chest you don't own");
155                                  server.getLogger().info( player.getName() + " tried to remove protection froma chest owned by " + chest.getOwner() );                                  server.getLogger().info( player.getName() + " tried to remove protection froma chest owned by " + chest.getOwner() );
156                                  return true;                                  return true;
# Line 165  public class AdvancedChest  implements L Line 167  public class AdvancedChest  implements L
167                                  player.sendMessage("This chest is not protected");                                  player.sendMessage("This chest is not protected");
168                                  return true;                                  return true;
169                          }                          }
170                          if (! chest.getOwner().equals( player.getName() ) ) {                          if ( chest.getOwner().equals( player.getName() ) || player.isOp() ) {
171                                    //do nothing
172                            } else {
173                                  player.sendMessage("You can not set new owner of a chest you dont own");                                  player.sendMessage("You can not set new owner of a chest you dont own");
174                                  server.getLogger().info( player.getName() + " tried to set owner on a chest owned by " + chest.getOwner() );                                  server.getLogger().info( player.getName() + " tried to set owner on a chest owned by " + chest.getOwner() );
175                                  return true;                                  return true;
# Line 470  public class AdvancedChest  implements L Line 474  public class AdvancedChest  implements L
474                                          return; //chest is opened by it's owner                                          return; //chest is opened by it's owner
475                                  }                                  }
476                                                                    
477                                  Set<String> players = Util.stringToSet( chest.getModifyPlayers() );                                  Set<String> players = chest.getModifyPlayersSet() ;
478                                  if ( players.contains(player.getName()) ) {                                  if ( players.contains(player.getName()) ) {
479                                          return; //this player is on the whitelist so he may open                                          return; //this player is on the whitelist so he may open
480                                  }                                  }
# Line 511  public class AdvancedChest  implements L Line 515  public class AdvancedChest  implements L
515                                  return; //chest is owned by it's own player                                  return; //chest is owned by it's own player
516                          }                          }
517                                                    
518                          Set<String> players = Util.stringToSet( chest.getModifyPlayers() );                          Set<String> players = chest.getModifyPlayersSet();
519                          if ( players.contains(player.getName()) ) {                          if ( players.contains(player.getName()) ) {
520                                  return; //this player is on the whitelist so he may open                                  return; //this player is on the whitelist so he may open
521                          }                          }
# Line 582  public class AdvancedChest  implements L Line 586  public class AdvancedChest  implements L
586                                          String msg = null;                                          String msg = null;
587                                                                                    
588                                          if (count > savedcount) {                                          if (count > savedcount) {
589                                                  msg = player.getName() + " added "   + diff + " units of " + material + "(" +item + ") to "   + owner.getName() + "'s chest at " + loc.getWorld().getName() + "," + loc.getBlockX() + "," +loc.getBlockY() + "," + loc.getBlockZ();                                                  msg = player.getName() + " added "   + diff + " units of " + material + "(" +item + ") to "   + owner.getName() + "'s chest at " + loc.getWorld().getName() + "," + loc.getBlockX() + "," +loc.getBlockY() + "," + loc.getBlockZ() + chest.getCommentString();
590                                          } else { //(count < savedcount)                                          } else { //(count < savedcount)
591                                                  msg = player.getName() + " removed " + diff + " units of " + material + "(" +item + ") from " + owner.getName() + "'s chest at " + loc.getWorld().getName() + "," + loc.getBlockX() + "," +loc.getBlockY() + "," + loc.getBlockZ();                                                  msg = player.getName() + " removed " + diff + " units of " + material + "(" +item + ") from " + owner.getName() + "'s chest at " + loc.getWorld().getName() + "," + loc.getBlockX() + "," +loc.getBlockY() + "," + loc.getBlockZ() + chest.getCommentString();
592                                          }                                          }
593                                                                    
594                                                                    

Legend:
Removed from v.1874  
changed lines
  Added in v.1916

  ViewVC Help
Powered by ViewVC 1.1.20