137 |
addChest(loc, chest); |
addChest(loc, chest); |
138 |
player.sendMessage("Chest is now " + modeStr); |
player.sendMessage("Chest is now " + modeStr); |
139 |
} else { |
} else { |
140 |
|
server.getLogger().info( player.getName() + " tried to protect a chest owned by " + chest.getOwner() ); |
141 |
player.sendMessage("This chest is already protected"); |
player.sendMessage("This chest is already protected"); |
142 |
} |
} |
143 |
return true; |
return true; |
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() ); |
156 |
return true; |
return true; |
157 |
} |
} |
158 |
|
|
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() ); |
175 |
return true; |
return true; |
176 |
} |
} |
177 |
if (args.length != 2) { |
if (args.length != 2) { |
196 |
} |
} |
197 |
if (! chest.getOwner().equals( player.getName() ) ) { |
if (! chest.getOwner().equals( player.getName() ) ) { |
198 |
player.sendMessage("You can not add/remove players from a chest you don't own"); |
player.sendMessage("You can not add/remove players from a chest you don't own"); |
199 |
|
server.getLogger().info( player.getName() + " tried to add/remove player on a chest owned by " + chest.getOwner() ); |
200 |
return true; |
return true; |
201 |
} |
} |
202 |
if (args.length != 2) { |
if (args.length != 2) { |
226 |
player.sendMessage("This chest is not protected"); |
player.sendMessage("This chest is not protected"); |
227 |
return true; |
return true; |
228 |
} |
} |
229 |
if (! chest.getOwner().equals( player.getName() ) ) { |
if (! chest.getOwner().equals( player.getName() ) ) { |
230 |
player.sendMessage("You can not comment a chest you don't own"); |
player.sendMessage("You can not comment a chest you don't own"); |
231 |
|
server.getLogger().info( player.getName() + " tried to comment on a chest owned by " + chest.getOwner() ); |
232 |
return true; |
return true; |
233 |
} |
} |
234 |
|
|
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 |
|
|