--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/AdvancedChest.java 2012/06/03 20:16:40 1808 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/AdvancedChest.java 2012/06/03 20:34:42 1809 @@ -395,15 +395,12 @@ return; //chest is opened by it's owner } - if (chest.getModifyPlayers() != null && chest.getModifyPlayers().length()>0) { - String modplayers[] = chest.getModifyPlayers().split(","); - for (String p : modplayers) { - if ( player.getName().equals(p) ) { - return; //this player is on the whitelist so he may open - } - } + Set players = Util.stringToSet( chest.getModifyPlayers() ); + if ( players.contains(player.getName()) ) { + return; //this player is on the whitelist so he may open } + player.sendMessage( ChatColor.BLUE + "Sorry but this chest is locked !"); event.setCancelled(true); @@ -437,7 +434,12 @@ Player player = (Player) event.getPlayer(); if (player.getName().equals(chest.getOwner() )) { return; //chest is owned by it's own player - } + } + + Set players = Util.stringToSet( chest.getModifyPlayers() ); + if ( players.contains(player.getName()) ) { + return; //this player is on the whitelist so he may open + } ItemCount contents = countItems( event.getInventory().getContents() );