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