From e4e49f10e2fb40c5f03202ceb0bd24b3c4ad5fae Mon Sep 17 00:00:00 2001 From: Chipmunk <65827213+ChipmunkMC@users.noreply.github.com> Date: Tue, 18 Jun 2024 00:22:21 -0400 Subject: [PATCH] block /debugdim --- .../extras/mixin/DebugDimCommandMixin.java | 16 ++++++++++++++++ src/main/resources/extras.mixins.json | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/main/java/land/chipmunk/kaboomfabric/extras/mixin/DebugDimCommandMixin.java diff --git a/src/main/java/land/chipmunk/kaboomfabric/extras/mixin/DebugDimCommandMixin.java b/src/main/java/land/chipmunk/kaboomfabric/extras/mixin/DebugDimCommandMixin.java new file mode 100644 index 0000000..09fdfc0 --- /dev/null +++ b/src/main/java/land/chipmunk/kaboomfabric/extras/mixin/DebugDimCommandMixin.java @@ -0,0 +1,16 @@ +package land.chipmunk.kaboomfabric.extras.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import com.mojang.brigadier.CommandDispatcher; +import net.minecraft.server.command.ServerCommandSource; + +@Mixin(net.minecraft.server.command.DebugDimCommand.class) +public abstract class DebugDimCommandMixin { + @Inject(at = @At("HEAD"), method = "register", cancellable = true) + private static void register (CommandDispatcher dispatcher, CallbackInfo info) { + info.cancel(); + } +} diff --git a/src/main/resources/extras.mixins.json b/src/main/resources/extras.mixins.json index eb8e23c..302e40a 100644 --- a/src/main/resources/extras.mixins.json +++ b/src/main/resources/extras.mixins.json @@ -12,7 +12,8 @@ "OpCommandMixin", "EntitySelectorMixin", "ServerWorldAccessor", - "EntityAccessor" + "EntityAccessor", + "DebugDimCommandMixin" ], "injectors": { "defaultRequire": 1