1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-18 09:43:00 +01:00

Added a /freeze command for fun

This commit is contained in:
nossr50
2010-12-15 16:22:48 -08:00
parent 53c00d6c55
commit ad29bb2bbb
4 changed files with 46 additions and 1 deletions

View File

@@ -176,7 +176,39 @@ public class vMinecraftCommands{
.globalmessages());
return EXIT_SUCCESS;
}
//=====================================================================
//Function: prefix (/prefix)
//Input: Player player: The player using the command
// String[] args: The name of the player
//Output: int: Exit Code
//Use: Freezes a player in place
//=====================================================================
public static int freeze(Player player, String[] args){
if(player.canUseCommand("/freeze")){
if (args.length < 2){
vMinecraftChat.gmsg(Colors.Rose + "Usage is /freeze [Player]");
return EXIT_SUCCESS;
}
Player other = etc.getServer().matchPlayer(args[0]);
if (other == null)
{
vMinecraftChat.gmsg(Colors.Rose + "The player you specified could not be found");
return EXIT_SUCCESS;
}
if(player != other && other.hasControlOver(player)){
vMinecraftChat.gmsg(Colors.Rose + "The player you specified has a higher rank than you");
return EXIT_SUCCESS;
}
if(vMinecraftSettings.frozenplayers.contains(other)){
vMinecraftSettings.getInstance().removeFrozen(other.getName());
return EXIT_SUCCESS;
}
vMinecraftSettings.getInstance().addFrozen(other.getName());
vMinecraftChat.gmsg(player.getName() + Colors.Blue + " has frozen " + other.getName());
return EXIT_SUCCESS;
}
return EXIT_SUCCESS;
}
//=====================================================================
//Function: prefix (/prefix)
//Input: Player player: The player using the command