corrected (hopefully) the chat response for show/hide commands

This commit is contained in:
Arthur Mayer 2011-02-20 20:06:07 +01:00
parent e15514291b
commit 298c0f3391

View File

@ -36,23 +36,25 @@ public class DynmapPlayerListener extends PlayerListener {
event.setCancelled(true); event.setCancelled(true);
} else if (split[1].equals("hide")) { } else if (split[1].equals("hide")) {
Player player = event.getPlayer(); Player player = event.getPlayer();
player.sendMessage("You are now hidden on Dynmap."); if (split.length == 2) {
if (split.length == 2) {
playerList.hide(player.getName()); playerList.hide(player.getName());
player.sendMessage("You are now hidden on Dynmap.");
} else { } else {
for (int i = 2; i < split.length; i++) { for (int i = 2; i < split.length; i++) {
playerList.hide(split[i]); playerList.hide(split[i]);
player.sendMessage(split[i] + " is now hidden on Dynmap.");
} }
} }
event.setCancelled(true); event.setCancelled(true);
} else if (split[1].equals("show")) { } else if (split[1].equals("show")) {
Player player = event.getPlayer(); Player player = event.getPlayer();
player.sendMessage("You are now visible on Dynmap."); if (split.length == 2) {
if (split.length == 2) {
playerList.show(player.getName()); playerList.show(player.getName());
player.sendMessage("You are now visible on Dynmap.");
} else { } else {
for (int i = 2; i < split.length; i++) { for (int i = 2; i < split.length; i++) {
playerList.show(split[i]); playerList.show(split[i]);
player.sendMessage(split[i] + " is now visible on Dynmap.");
} }
} }
event.setCancelled(true); event.setCancelled(true);