--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/AdvancedChest.java 2012/11/05 21:46:57 1868 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/AdvancedChest.java 2012/11/06 16:49:06 1869 @@ -77,7 +77,7 @@ if (args.length == 0) { player.sendMessage("Usage:"); - player.sendMessage("/chest (status|lock|snitch|remove|addplayer|removeplayer|setowner) [player]"); + player.sendMessage("/chest (status|lock|snitch|remove|addplayer|removeplayer|setowner|comment) [player]"); return true; } @@ -111,6 +111,7 @@ player.sendMessage(ChatColor.GREEN + "Chest is a " + mode + " chest owned by " + chest.getOwner()); player.sendMessage(ChatColor.GREEN + "Allowed players: " + chest.getModifyPlayers() ); + player.sendMessage(ChatColor.GREEN + "Comment: " + chest.getComment() ); } else { player.sendMessage(ChatColor.GREEN + "The chest is not protected"); } @@ -132,6 +133,7 @@ modeStr = "snitching"; } chest.setModifyPlayers(""); + chest.setComment(""); addChest(loc, chest); player.sendMessage("Chest is now " + modeStr); } else { @@ -211,6 +213,28 @@ player.sendMessage("ok"); return true; } + if (cmd.equals("comment")) { + if (chest == null) { + player.sendMessage("This chest is not protected"); + return true; + } + if (! chest.getOwner().equals( player.getName() ) ) { + player.sendMessage("You can not comment a chest you don't own"); + return true; + } + + StringBuilder sb = new StringBuilder(); + for (int i=1; i