395 |
return; //chest is opened by it's owner |
return; //chest is opened by it's owner |
396 |
} |
} |
397 |
|
|
398 |
if (chest.getModifyPlayers() != null && chest.getModifyPlayers().length()>0) { |
Set<String> players = Util.stringToSet( chest.getModifyPlayers() ); |
399 |
String modplayers[] = chest.getModifyPlayers().split(","); |
if ( players.contains(player.getName()) ) { |
400 |
for (String p : modplayers) { |
return; //this player is on the whitelist so he may open |
|
if ( player.getName().equals(p) ) { |
|
|
return; //this player is on the whitelist so he may open |
|
|
} |
|
|
} |
|
401 |
} |
} |
402 |
|
|
403 |
|
|
404 |
|
|
405 |
player.sendMessage( ChatColor.BLUE + "Sorry but this chest is locked !"); |
player.sendMessage( ChatColor.BLUE + "Sorry but this chest is locked !"); |
406 |
event.setCancelled(true); |
event.setCancelled(true); |
434 |
Player player = (Player) event.getPlayer(); |
Player player = (Player) event.getPlayer(); |
435 |
if (player.getName().equals(chest.getOwner() )) { |
if (player.getName().equals(chest.getOwner() )) { |
436 |
return; //chest is owned by it's own player |
return; //chest is owned by it's own player |
437 |
} |
} |
438 |
|
|
439 |
|
Set<String> players = Util.stringToSet( chest.getModifyPlayers() ); |
440 |
|
if ( players.contains(player.getName()) ) { |
441 |
|
return; //this player is on the whitelist so he may open |
442 |
|
} |
443 |
|
|
444 |
|
|
445 |
ItemCount contents = countItems( event.getInventory().getContents() ); |
ItemCount contents = countItems( event.getInventory().getContents() ); |