This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
72 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package me.mlg.rat.commands; | ||
|
||
import me.mlg.rat.handlers.ConfigHandler; | ||
import me.mlg.rat.utils.Utils; | ||
import net.minecraft.command.CommandBase; | ||
import net.minecraft.command.CommandException; | ||
import net.minecraft.command.ICommandSender; | ||
import net.minecraft.util.ChatComponentText; | ||
|
||
public class DebugCommand extends CommandBase { | ||
@Override | ||
public String getCommandName() { | ||
return "rat"; | ||
} | ||
|
||
@Override | ||
public String getCommandUsage(ICommandSender sender) { | ||
return "rat istoggled/addchatmessage value type"; | ||
} | ||
|
||
@Override | ||
public boolean canCommandSenderUseCommand(ICommandSender sender) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public int getRequiredPermissionLevel() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void processCommand(ICommandSender sender, String[] args) throws CommandException { | ||
switch(args[0]) { | ||
case "istoggled": | ||
switch(args[2]) { | ||
case "boolean": | ||
Utils.mc.thePlayer.addChatMessage(new ChatComponentText("" + ConfigHandler.getBoolean("toggle", args[1]))); | ||
break; | ||
case "string": | ||
Utils.mc.thePlayer.addChatMessage(new ChatComponentText(ConfigHandler.getString("toggle", args[1]))); | ||
break; | ||
case "integer": | ||
Utils.mc.thePlayer.addChatMessage(new ChatComponentText("" + ConfigHandler.getInt("toggle", args[1]))); | ||
break; | ||
case "double": | ||
Utils.mc.thePlayer.addChatMessage(new ChatComponentText("" + ConfigHandler.getDouble("toggle", args[1]))); | ||
break; | ||
default: | ||
Utils.printErrorMessage("Invalid argument at istoggled; args[1]"); | ||
} | ||
break; | ||
case "addchatmessage": | ||
Utils.mc.thePlayer.addChatMessage(new ChatComponentText(args[1])); | ||
break; | ||
default: | ||
Utils.mc.thePlayer.addChatMessage(new ChatComponentText(getCommandUsage(sender))); | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters