Skip to content

Commit adc3847

Browse files
committed
Adjust command stack trace dumper to be logger-only
1 parent a6df613 commit adc3847

3 files changed

Lines changed: 28 additions & 21 deletions

File tree

src/main/java/net/modfest/fireblanket/mixin/annoyances/commands/MixinCommands.java

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package net.modfest.fireblanket.mixin.diagnostics.commands;
2+
3+
import com.llamalad7.mixinextras.sugar.Local;
4+
import net.minecraft.commands.Commands;
5+
import net.modfest.fireblanket.Fireblanket;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.injection.At;
8+
import org.spongepowered.asm.mixin.injection.Inject;
9+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10+
11+
/**
12+
* @author Ampflower
13+
**/
14+
@Mixin(Commands.class)
15+
public class MixinCommands {
16+
@Inject(
17+
method = "performCommand",
18+
at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;isDebugEnabled()Z")
19+
)
20+
private static void whatWeAreAlwaysInADeveloperEnvironmentWhatDoYouMean(
21+
final CallbackInfo ci,
22+
final @Local(argsOnly = true) String commandString,
23+
final @Local Exception exception
24+
) {
25+
Fireblanket.LOGGER.warn("Command `/{}` threw an exception", commandString, exception);
26+
}
27+
}

src/main/resources/fireblanket.mixins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"ai.MixinTemptGoal",
3131
"annoyances.MixinServerPlayNetworkHandler",
3232
"annoyances.MixinUtil",
33-
"annoyances.commands.MixinCommands",
3433
"annoyances.lightning.MixinServerChunkLoadingManager",
3534
"be_sync.MixinBlockEntity",
3635
"be_sync.MixinChunkHolder",
@@ -49,6 +48,7 @@
4948
"crash.MixinCraftingScreenHandler",
5049
"criterion.MixinServerPlayerEntity",
5150
"datafixerupper.MixinCodec",
51+
"diagnostics.commands.MixinCommands",
5252
"diagnostics.net.MixinConnection",
5353
"entity_block.MixinEntityType",
5454
"entity_immutability.MixinDecorationItem",

0 commit comments

Comments
 (0)