aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/commands
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-12-30 01:48:09 +0000
committerGitHub <noreply@github.com>2019-12-30 01:48:09 +0000
commit5af823e80a611090216375fecd3794d345446830 (patch)
treec54a19977b4a25cb86f54394eb9711aaf268efe3 /src/Java/gtPlusPlus/core/commands
parenta731e939c6b9a70ac9fd444dbf06243f63f29c06 (diff)
parentcc825179dce70a5f2c4a13730639e3300243e21a (diff)
downloadGT5-Unofficial-5af823e80a611090216375fecd3794d345446830.tar.gz
GT5-Unofficial-5af823e80a611090216375fecd3794d345446830.tar.bz2
GT5-Unofficial-5af823e80a611090216375fecd3794d345446830.zip
Merge pull request #525 from alkcorp/DevTop
+ 6 Months of work, let's get the ball rolling.
Diffstat (limited to 'src/Java/gtPlusPlus/core/commands')
-rw-r--r--src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java46
1 files changed, 39 insertions, 7 deletions
diff --git a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
index 3a7d4461f4..5b9c17bacf 100644
--- a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
+++ b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
@@ -7,6 +7,7 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.preloader.asm.AsmConfig;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
@@ -33,6 +34,9 @@ public class CommandEnableDebugWhileRunning implements ICommand
}
+
+ // Use '/debugmodegtpp' along with 'logging' or 'debug' to toggle Debug mode and Logging.
+ // Using nothing after the command toggles both to their opposite states respectively.
@Override
public String getCommandUsage(final ICommandSender var1){
return "/debugmodegtpp";
@@ -47,16 +51,44 @@ public class CommandEnableDebugWhileRunning implements ICommand
@Override
public void processCommand(final ICommandSender S, final String[] argString){
- Logger.INFO("Toggling Debug Mode");
- final World W = S.getEntityWorld();
- final EntityPlayer P = CommandUtils.getPlayer(S);
-
- if (PlayerUtils.isPlayerOP(P)) {
- CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG);
- PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG);
+ if (argString == null || argString.length == 0 || argString.length > 1) {
+ Logger.INFO("Toggling Debug Mode & Logging.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (PlayerUtils.isPlayerOP(P)) {
+ CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG);
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG);
+ AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: "+(!AsmConfig.disableAllLogging));
+ }
+ }
+ else {
+ if (argString[0].toLowerCase().equals("debug")) {
+ Logger.INFO("Toggling Debug Mode.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (PlayerUtils.isPlayerOP(P)) {
+ CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG);
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG);
+ }
+ }
+ else if (argString[0].toLowerCase().equals("logging")) {
+ Logger.INFO("Toggling Logging.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (PlayerUtils.isPlayerOP(P)) {
+ AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: "+(!AsmConfig.disableAllLogging));
+ }
+ }
+ else {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (PlayerUtils.isPlayerOP(P)) {
+ PlayerUtils.messagePlayer(P, "Invalid command, use 'debug' or 'logging'");
+ }
+ }
}
+
+
}
@Override