KubeJS (Old)

KubeJS (Old)

3M Downloads

Class x is not allowed error is not always correct

ChiefArug opened this issue ยท 0 comments

commented

Minecraft Version

Everything since at least 1.16

KubeJS Version

See above

Rhino Version

See above

Architectury Version

See above

Forge/Fabric Version

See above

Describe your issue

See this method in the the KubeJS script manager:

public NativeJavaClass loadJavaClass(Scriptable scope, Object[] args) {

If at any point it throws an exception it just throws a Class not allowed error. This causes stuff like a class not existing to just say its 'not allowed', causing a lot of confusion.

Suggested fix is to either say something more generic like 'KubeJS encountered an error while loading class x. This could be caused by it being blocked or it may not exist.' or actually print the error it throws instead of catching it and throwing this one.

Crash report/logs

No response