Skip to content

fix: skip duplicate TypeWrapper registration for MinMaxBounds.Ints#34

Open
CarlJlin wants to merge 1 commit intoAlmostReliable:1.20.1from
CarlJlin:1.20.1
Open

fix: skip duplicate TypeWrapper registration for MinMaxBounds.Ints#34
CarlJlin wants to merge 1 commit intoAlmostReliable:1.20.1from
CarlJlin:1.20.1

Conversation

@CarlJlin
Copy link
Copy Markdown

@CarlJlin CarlJlin commented Apr 5, 2026

Problem

KubeJS 2001.6.5 now registers a TypeWrapper for MinMaxBounds.Ints natively.
LootJS then tries to register it again in LootJSPlugin#registerTypeWrappers(),
causing an IllegalArgumentException crash on startup.

Fix

Wrapped the registerSimple() call for MinMaxBounds.Ints in a try/catch to
silently skip registration if the wrapper already exists.

Reproduction

  • KubeJS forge-2001.6.5-build.14+
  • LootJS forge-1.20.1-2.13.1
  • Rhino forge-2001.2.3-build.10

Tested

  • Minecraft 1.20.1 Forge 47.4.6
  • KubeJS forge-2001.6.5-build.16
  • LootJS forge-1.20.1-2.13.1 (this fix)
  • Rhino forge-2001.2.3-build.10
  • Woot Revived

Game boots successfully, no crash on startup.

crash-2026-04-05_13.25.40-fml.txt

@LLytho
Copy link
Copy Markdown
Member

LLytho commented Apr 5, 2026

https://github.com/KubeJS-Mods/KubeJS/blob/2001/common/src/main/java/dev/latvian/mods/kubejs/BuiltinKubeJSPlugin.java

Has no single mention of MinMaxBounds. Looks more like some other mod adds it. Where do you get the info that KubeJS 2001.6.5 adds it?

GitHub
Contribute to KubeJS-Mods/KubeJS development by creating an account on GitHub.

@CarlJlin
Copy link
Copy Markdown
Author

CarlJlin commented Apr 6, 2026

You're right, I apologize for the incorrect assumption. KubeJS indeed doesn't register MinMaxBounds.Ints.

I ran a search through all the jars in my modpack to find which mod registers it first:

Get-ChildItem "*.jar" | ForEach-Object {
    $found = jar tf $_.FullName | Select-String "MinMaxBounds"
    if ($found) { Write-Host $_.Name }
}

Two mods came up: champions-forge-1.20.1-2.1.10.2.jar and CraftTweaker-forge-1.20.1-14.0.60.jar.

Digging further, Champions is the culprit, it has a dedicated KubeJS integration that registers a MinMaxBoundsIntsJS TypeWrapper via its own ChampionsKubeJSPlugin:

top/theillusivec4/champions/common/integration/kubejs/ChampionsKubeJSPlugin.class
top/theillusivec4/champions/common/integration/kubejs/wrapper/MinMaxBoundsIntsJS.class
CraftTweaker also references MinMaxBounds but uses its own ZenScript system (ExpandMinMaxBoundsInts), unrelated to Rhino's TypeWrappers.

So the conflict is between Champions and LootJS, both register a TypeWrapper for MinMaxBounds.Ints via KubeJS. The fix (try/catch) still resolves the crash regardless of which mod registers it first. Would you prefer a different approach, such as checking if the wrapper already exists before registering?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants