Skip to content

StackOverflowError when a managed key has a native modifier #24

Open

Description

@LegendaryRylex

Minecraft Version

26.1 (LTS)

Mod Loader

NeoForge

Describe the Issue

Kuma 26.1.2.2 (from Balm 26.1.2.15), 26.1.2 NeoForge.

A Kuma-managed key with a NeoForge modifier in options.txt crashes the client with a StackOverflowError. For example:

key_key.trashslot.delete_all:key.keyboard.delete:CONTROL

KeyMappingMixin.kuma$getModifiers() calls NativeKeyModifierReconciler.reconcile(this) first. When the native modifier is not empty, reconcile calls kumaKeyMapping.kuma$getModifiers() on the same mapping to check if Kuma already has modifiers. That calls reconcile again, so it never reaches setNativeKeyModifiers(keyMapping, KeyModifiers.none()), which would end the loop.

java.lang.StackOverflowError: Unexpected error
	at net.blay09.mods.kuma.api.KeyModifiers.of(KeyModifiers.java:135)
	at net.blay09.mods.kuma.neoforge.NeoForgeKeyModifiers.fromNeoForge(NeoForgeKeyModifiers.java:23)
	at net.blay09.mods.kuma.neoforge.NeoForgeKumaRuntime.getNativeKeyModifiers(NeoForgeKumaRuntime.java:36)
	at net.blay09.mods.kuma.NativeKeyModifierReconciler.reconcile(NativeKeyModifierReconciler.java:18)
	at net.minecraft.client.KeyMapping.kuma$getModifiers(KeyMapping.java:2073)
	at net.blay09.mods.kuma.NativeKeyModifierReconciler.reconcile(NativeKeyModifierReconciler.java:24)
	at net.minecraft.client.KeyMapping.kuma$getModifiers(KeyMapping.java:2073)
	[...]

The same code is still on the 26.3 branch.

How to reproduce:

  1. Install Balm and Trash Slot
  2. Set key_key.trashslot.delete_all:key.keyboard.delete:CONTROL in options.txt
  3. Launch the game

Our pack shipped that line in its default options.txt, so every new install crashed. On our end we moved the modifier into config/kuma.json instead.

Logs

https://pste.me/@I-oSdZqu2J0

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working as expectedMinecraft 26.1NeoForgeIssues occurring on the NeoForge platform

    Type

    Projects

    • Status
      🚀 Pending Release

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions