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; |
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; |
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 |
} |
} |
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 |
} |
} |
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 |
|
|