mirror of
https://github.com/Wurst-Imperium/Wurst7.git
synced 2024-09-20 01:12:13 +02:00
Add GmCmd
This commit is contained in:
parent
be5ad171b4
commit
b797848497
@ -17,6 +17,7 @@ import net.wurstclient.commands.AnnoyCmd;
|
||||
import net.wurstclient.commands.AuthorCmd;
|
||||
import net.wurstclient.commands.BindsCmd;
|
||||
import net.wurstclient.commands.ClearCmd;
|
||||
import net.wurstclient.commands.GmCmd;
|
||||
import net.wurstclient.commands.HelpCmd;
|
||||
import net.wurstclient.commands.SayCmd;
|
||||
|
||||
@ -39,7 +40,7 @@ public final class CmdList
|
||||
// public final GetPosCmd getPosCmd = new GetPosCmd();
|
||||
// public final GhostHandCmd ghostHandCmd = new GhostHandCmd();
|
||||
// public final GiveCmd giveCmd = new GiveCmd();
|
||||
// public final GmCmd gmCmd = new GmCmd();
|
||||
public final GmCmd gmCmd = new GmCmd();
|
||||
// public final GoToCmd goToCmd = new GoToCmd();
|
||||
public final HelpCmd helpCmd = new HelpCmd();
|
||||
// public final InvseeCmd invseeCmd = new InvseeCmd();
|
||||
|
54
src/main/java/net/wurstclient/commands/GmCmd.java
Normal file
54
src/main/java/net/wurstclient/commands/GmCmd.java
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2014 - 2019 | Wurst-Imperium | All rights reserved.
|
||||
*
|
||||
* This source code is subject to the terms of the GNU General Public
|
||||
* License, version 3. If a copy of the GPL was not distributed with this
|
||||
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
*/
|
||||
package net.wurstclient.commands;
|
||||
|
||||
import net.wurstclient.command.CmdException;
|
||||
import net.wurstclient.command.CmdSyntaxError;
|
||||
import net.wurstclient.command.Command;
|
||||
|
||||
public final class GmCmd extends Command
|
||||
{
|
||||
public GmCmd()
|
||||
{
|
||||
super("gm", "Shortcut for /gamemode.", ".gm <gamemode>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void call(String[] args) throws CmdException
|
||||
{
|
||||
if(args.length < 1)
|
||||
throw new CmdSyntaxError();
|
||||
|
||||
String args2 = String.join(" ", args);
|
||||
switch(args2)
|
||||
{
|
||||
case "s":
|
||||
case "0":
|
||||
args2 = "survival";
|
||||
break;
|
||||
|
||||
case "c":
|
||||
case "1":
|
||||
args2 = "creative";
|
||||
break;
|
||||
|
||||
case "a":
|
||||
case "2":
|
||||
args2 = "adventure";
|
||||
break;
|
||||
|
||||
case "sp":
|
||||
case "3":
|
||||
args2 = "spectator";
|
||||
break;
|
||||
}
|
||||
|
||||
String message = "/gamemode " + args2;
|
||||
MC.player.sendChatMessage(message);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user