mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Removed pointless check, added comment for adminChatToggle in vminecraftCommands.
This commit is contained in:
parent
0abd500f63
commit
e013ac787d
@ -46,22 +46,28 @@ public class vminecraftCommands{
|
||||
cl.registerAlias("/wrists", "/suicide");
|
||||
cl.registerAlias("/ci", "/clearinventory");
|
||||
}
|
||||
public static int adminChatToggle(Player player, String[] args)
|
||||
//=====================================================================
|
||||
//Function: adminChatToggle (/a)
|
||||
//Input: Player player: The player using the command
|
||||
//Output: int: Exit Code
|
||||
//Use: Toggles the player into admin chat. Every message they
|
||||
// send will be piped to admin chat.
|
||||
//=====================================================================
|
||||
|
||||
public static int adminChatToggle(Player player)
|
||||
{
|
||||
if(vminecraftSettings.getInstance().adminChatToggle())
|
||||
{
|
||||
if (vminecraftSettings.getInstance().cmdAdminToggle) {
|
||||
//If the player is already toggled for admin chat, remove them
|
||||
if (vminecraftSettings.getInstance().isAdminToggled(player.getName())) {
|
||||
player.sendMessage(Colors.Red + "Admin Chat Toggle = off");
|
||||
vminecraftSettings.getInstance().removeAdminToggled(player.getName());
|
||||
//Otherwise include them
|
||||
} else {
|
||||
player.sendMessage(Colors.Blue + "Admin Chat Toggled on");
|
||||
vminecraftSettings.getInstance().addAdminToggled(player.getName());
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
//If the player is already toggled for admin chat, remove them
|
||||
if (vminecraftSettings.getInstance().isAdminToggled(player.getName())) {
|
||||
player.sendMessage(Colors.Red + "Admin Chat Toggle = off");
|
||||
vminecraftSettings.getInstance().removeAdminToggled(player.getName());
|
||||
//Otherwise include them
|
||||
} else {
|
||||
player.sendMessage(Colors.Blue + "Admin Chat Toggled on");
|
||||
vminecraftSettings.getInstance().addAdminToggled(player.getName());
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
return EXIT_FAIL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user