diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-24 01:01:10 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-24 01:01:10 +0100 |
commit | 24110c24af3ed14c0da050a2cdb1053b183b30b6 (patch) | |
tree | d2064615a58240ec111fb2f307cba5078842eee6 /src/main/java | |
parent | 39d35afb702cf017569ef9594774561848db7494 (diff) | |
download | Firmament-24110c24af3ed14c0da050a2cdb1053b183b30b6.tar.gz Firmament-24110c24af3ed14c0da050a2cdb1053b183b30b6.tar.bz2 Firmament-24110c24af3ed14c0da050a2cdb1053b183b30b6.zip |
feat: Add /firm timer command
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/AlwaysDisplayFirmamentClientCommandErrors.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/AlwaysDisplayFirmamentClientCommandErrors.java b/src/main/java/moe/nea/firmament/mixins/AlwaysDisplayFirmamentClientCommandErrors.java new file mode 100644 index 0000000..59769c6 --- /dev/null +++ b/src/main/java/moe/nea/firmament/mixins/AlwaysDisplayFirmamentClientCommandErrors.java @@ -0,0 +1,18 @@ +package moe.nea.firmament.mixins; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import com.llamalad7.mixinextras.sugar.Local; +import net.fabricmc.fabric.impl.command.client.ClientCommandInternals; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@Mixin(ClientCommandInternals.class) +public class AlwaysDisplayFirmamentClientCommandErrors { + @ModifyExpressionValue(method = "executeCommand", at = @At(value = "INVOKE", target = "Lnet/fabricmc/fabric/impl/command/client/ClientCommandInternals;isIgnoredException(Lcom/mojang/brigadier/exceptions/CommandExceptionType;)Z")) + private static boolean markFirmamentExceptionsAsNotIgnores(boolean original, @Local(argsOnly = true) String command) { + if (command.startsWith("firm ") || command.equals("firm") || command.startsWith("firmament ") || command.equals("firmament")) { + return false; + } + return original; + } +} |