
[Mod Compat] Custom KubeJS enchantments make EMI spam the log endlessly
Rimevel opened this issue ยท 1 comments
Testing environment
Minecraft Forge 1.20.1
Modlist
KubeJS
Architectury
ModernFix
Ferrite Core
EMI
ProbeJS
Rhino
Just Enough Items
All mods in list have their default configuration
Description of issue
I have made and registered a new custom enchant using KubeJS. This is the startup script that I use:
StartupEvents.registry('minecraft:enchantment', event => {
/**
* Check if the item is a tool and NOT a weapon
* @param {Internal.ItemStack} stack
* @returns {boolean}
*/
function isTool(stack) {
return stack.hasTag('minecraft:pickaxes') | stack.hasTag('minecraft:axes') | stack.hasTag('minecraft:shovels');
}
/**
* Check if the item contain other unique enchantments
* @param {Internal.ItemStack} stack
* @param {Special.Enchantment}
* @returns {boolean}
*/
function noUniques(stack) {
return !stack.hasEnchantment('minecraft:mending', 1) && !stack.hasEnchantment('minecraft:silk_touch');
}
event.create('kubejs:construction', 'basic')
.maxLevel(1)
.rare()
.canEnchant((stack) => { return isTool(stack) && noUniques(stack); })
.slots(['mainhand', 'offhand']);
});
As soon as a world is loaded, the log starts getting spammed by these lines:
[19:22:30] [Thread-16/ERROR] [EMI/]: Exception thrown registering enchantment recipes
dev.latvian.mods.rhino.EvaluatorException: Cannot convert 0.0 to boolean
at dev.latvian.mods.rhino.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:67) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at dev.latvian.mods.rhino.Context.reportRuntimeError(Context.java:133) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at dev.latvian.mods.rhino.Context.reportRuntimeError(Context.java:173) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at dev.latvian.mods.rhino.Context.reportRuntimeError2(Context.java:150) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at dev.latvian.mods.rhino.NativeJavaObject.reportConversionError(NativeJavaObject.java:562) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at dev.latvian.mods.rhino.NativeJavaObject.reportConversionError(NativeJavaObject.java:556) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at dev.latvian.mods.rhino.NativeJavaObject.coerceTypeImpl(NativeJavaObject.java:312) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at dev.latvian.mods.rhino.Context.jsToJava(Context.java:237) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at dev.latvian.mods.rhino.InterfaceAdapter.invoke(InterfaceAdapter.java:130) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at dev.latvian.mods.rhino.VMBridge.lambda$newInterfaceProxy$0(VMBridge.java:74) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at jdk.proxy2.$Proxy50.getBoolean(Unknown Source) ~[?:?] {}
at it.unimi.dsi.fastutil.objects.Object2BooleanFunction.get(Object2BooleanFunction.java:138) ~[fastutil-8.5.9.jar%23122!/:?] {}
at java.lang.reflect.InvocationHandler.invokeDefault(InvocationHandler.java:286) ~[?:?] {}
at dev.latvian.mods.rhino.VMBridge.lambda$newInterfaceProxy$0(VMBridge.java:72) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at jdk.proxy2.$Proxy50.get(Unknown Source) ~[?:?] {}
at it.unimi.dsi.fastutil.Function.apply(Function.java:93) ~[fastutil-8.5.9.jar%23122!/:?] {re:mixin}
at java.lang.reflect.InvocationHandler.invokeDefault(InvocationHandler.java:286) ~[?:?] {}
at dev.latvian.mods.rhino.VMBridge.lambda$newInterfaceProxy$0(VMBridge.java:72) ~[rhino-forge-2001.2.3-build.10.jar%23171!/:2001.2.3-build.10] {re:classloading}
at jdk.proxy2.$Proxy50.apply(Unknown Source) ~[?:?] {}
at dev.latvian.mods.kubejs.misc.BasicEnchantment.m_6081_(BasicEnchantment.java:83) ~[kubejs-forge-2001.6.5-build.16.jar%23168!/:2001.6.5-build.16] {re:classloading}
at dev.emi.emi.VanillaPlugin.addRepair(VanillaPlugin.java:519) ~[emi-1.1.20+1.20.1+forge.jar%23165!/:?] {re:classloading}
at dev.emi.emi.VanillaPlugin.lambda$register$29(VanillaPlugin.java:461) ~[emi-1.1.20+1.20.1+forge.jar%23165!/:?] {re:classloading}
at dev.emi.emi.VanillaPlugin.safely(VanillaPlugin.java:825) ~[emi-1.1.20+1.20.1+forge.jar%23165!/:?] {re:classloading}
at dev.emi.emi.VanillaPlugin.register(VanillaPlugin.java:461) ~[emi-1.1.20+1.20.1+forge.jar%23165!/:?] {re:classloading}
at dev.emi.emi.runtime.EmiReloadManager$ReloadWorker.run(EmiReloadManager.java:188) ~[emi-1.1.20+1.20.1+forge.jar%23165!/:?] {re:classloading}
at java.lang.Thread.run(Thread.java:833) ~[?:?] {re:mixin}
This spam happens very rapidly, probably as often as once per tick. Removing EMI stops the spam from happening.