Fixed bug with silent toggle, cleaned up message informing players about /tpback

This commit is contained in:
nossr50 2011-01-05 07:34:38 -08:00
parent a22c04a725
commit 7a234a1be6
2 changed files with 16 additions and 11 deletions

View File

@ -210,10 +210,18 @@ private static HashMap<String, Player> hidden = new HashMap<String, Player>();
} }
public static int silent(Player player, String[] args){ public static int silent(Player player, String[] args){
if(player.canUseCommand("/silent")){ if(player.canUseCommand("/silent")){
if(!vMinecraftUsers.getProfile(player).isSilent()){
vMinecraftUsers.getProfile(player).setSilent(); vMinecraftUsers.getProfile(player).setSilent();
player.sendMessage(Colors.DarkPurple + "You are now silent"); player.sendMessage(Colors.DarkPurple + "You are now silent... shh");
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
if(vMinecraftUsers.getProfile(player).isSilent()){
vMinecraftUsers.getProfile(player).disableSilent();
player.sendMessage(Colors.DarkPurple + "You are no longer silent");
return EXIT_SUCCESS;
}
return EXIT_FAIL;
}
return EXIT_FAIL; return EXIT_FAIL;
} }
//Will make a player disappear or reappear //Will make a player disappear or reappear
@ -1174,7 +1182,8 @@ private static HashMap<String, Player> hidden = new HashMap<String, Player>();
String xyz = x2+","+y2+","+z2; String xyz = x2+","+y2+","+z2;
vMinecraftUsers.getProfile(player).setTpback(xyz); vMinecraftUsers.getProfile(player).setTpback(xyz);
if(player.canUseCommand("/tpback")){ if(player.canUseCommand("/tpback")){
player.sendMessage(Colors.DarkPurple + "Your previous location has been stored, use /tpback to return."); player.sendMessage(Colors.DarkPurple + "Your previous location has been stored");
player.sendMessage(Colors.DarkPurple + "Use /tpback to return");
} }
if(!vMinecraftUsers.getProfile(player).isSilent()){ if(!vMinecraftUsers.getProfile(player).isSilent()){
vMinecraftChat.gmsg( player, vMinecraftChat.getName(player) vMinecraftChat.gmsg( player, vMinecraftChat.getName(player)
@ -1270,7 +1279,8 @@ private static HashMap<String, Player> hidden = new HashMap<String, Player>();
vMinecraftUsers.getProfile(playerTarget).setTpback(xyz); vMinecraftUsers.getProfile(playerTarget).setTpback(xyz);
if(playerTarget.canUseCommand("/tpback")) if(playerTarget.canUseCommand("/tpback"))
{ {
playerTarget.sendMessage(Colors.DarkPurple + "Your previous location has been stored, use /tpback to return."); player.sendMessage(Colors.DarkPurple + "Your previous location has been stored");
player.sendMessage(Colors.DarkPurple + "Use /tpback to return");
} }
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;

View File

@ -517,12 +517,7 @@ class PlayerList
silent = false; silent = false;
} }
public boolean isSilent(){ public boolean isSilent(){
if(silent == true){ return silent;
return true;
}
else {
return false;
}
} }
//Store the player's party //Store the player's party
public void setParty(String newParty) public void setParty(String newParty)