KubeJS

KubeJS

69M Downloads

Defaultoptions in Forge 1.19.2 do not seem to take effect, but only for keybinds!

Raidobw2 opened this issue ยท 2 comments

commented

Minecraft Version

1.19.2

KubeJS Version

kubejs-forge-1902.6.0-build.142.jar

Rhino Version

rhino-forge-1902.2.2-build.264.jar

Architectury Version

architectury-6.5.69-forge.jar

Forge/Fabric Version

Forge 43.2.6

Describe your issue

In kubejs/config/defaultoptions.txt, if you set the following keybind for the multiplayer chat key:
image

Then make sure options.txt is deleted from the game folder, you can load the game and in-game the keybind will be:
image

Normally the key would be expected to be "Enter" or "Return", though in this case it remained to the default minecraft setting "T".

Note that sound setting overrides seem to work properly, although keybinds do not. Perhaps this is an issue pertaining only to keybinds in particular.

For example, setting master volume to 5% in the default options will correctly reflect 5% shown in the game menus, once the game loads up.

Please see the attached report below and note that the enter value was copy-pasted from the values themselves found in options.txt to defaultoptions.txt.
Here is the log file in case the paste withers away

Thanks a lot in advance for checking it out sometime!

Crash report/logs

https://paste.feed-the-beast.com/view/d62e02d4

commented

I just encountered this in 1.20.1, so it is still broken. Defining a keybind in defaultoptions.txt actually breaks the default options entirely. No other default option will be copied over. There is an associated error in the console:

Error
[17:37:57] [Render thread/ERROR] [minecraft/Options]: Failed to load options
java.lang.NumberFormatException: For input string: "key.keyboard.`"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) ~[?:?] {}
	at java.lang.Integer.parseInt(Integer.java:668) ~[?:?] {re:mixin}
	at java.lang.Integer.parseInt(Integer.java:786) ~[?:?] {re:mixin}
	at net.minecraft.util.datafix.fixes.OptionsKeyLwjgl3Fix.m_145579_(OptionsKeyLwjgl3Fix.java:162) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:classloading}
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?] {}
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992) ~[?:?] {}
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] {}
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?] {}
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?] {}
	at net.minecraft.util.datafix.fixes.OptionsKeyLwjgl3Fix.m_145576_(OptionsKeyLwjgl3Fix.java:183) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:classloading}
	at com.mojang.datafixers.util.Either$Left.mapBoth(Either.java:33) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.serialization.DataResult.map(DataResult.java:111) ~[datafixerupper-6.0.8.jar%23107!/:?] {re:mixin}
	at net.minecraft.util.datafix.fixes.OptionsKeyLwjgl3Fix.m_145574_(OptionsKeyLwjgl3Fix.java:160) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:classloading}
	at com.mojang.datafixers.Typed.lambda$updateCap$9(Typed.java:164) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.optics.Traversal$Instance$1.lambda$wander$0(Traversal.java:34) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.util.Pair$Instance.traverse(Pair.java:90) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.optics.profunctors.TraversalP$1.lambda$wander$0(TraversalP.java:50) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.optics.Traversal$Instance$1.lambda$wander$0(Traversal.java:34) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.optics.Traversal$Instance$1.lambda$wander$0(Traversal.java:34) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.Typed.updateCap(Typed.java:164) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.Typed.update(Typed.java:138) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.Typed.update(Typed.java:133) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at net.minecraft.util.datafix.fixes.OptionsKeyLwjgl3Fix.m_16632_(OptionsKeyLwjgl3Fix.java:159) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:classloading}
	at com.mojang.datafixers.DataFix.lambda$checked$3(DataFix.java:86) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.functions.Comp.applyUnchecked(Comp.java:126) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.functions.Comp.lambda$eval$2(Comp.java:118) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.types.Type.capWrite(Type.java:165) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.types.Type.lambda$readAndWrite$10(Type.java:157) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.serialization.DataResult.lambda$flatMap$11(DataResult.java:139) ~[datafixerupper-6.0.8.jar%23107!/:?] {re:mixin}
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.serialization.DataResult.flatMap(DataResult.java:137) ~[datafixerupper-6.0.8.jar%23107!/:?] {re:mixin}
	at com.mojang.datafixers.types.Type.readAndWrite(Type.java:156) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at com.mojang.datafixers.DataFixerUpper.update(DataFixerUpper.java:78) ~[datafixerupper-6.0.8.jar%23107!/:?] {}
	at org.embeddedt.modernfix.dfu.LazyDataFixer.update(LazyDataFixer.java:38) ~[modernfix-forge-5.18.1+mc1.20.1.jar%23370!/:5.18.1+mc1.20.1] {re:mixin,re:classloading}
	at net.minecraft.util.datafix.DataFixTypes.m_264080_(DataFixTypes.java:41) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:mixin,re:classloading,pl:mixin:APP:railways-common.mixins.json:MixinDataFixTypes,pl:mixin:A}
	at net.minecraft.util.datafix.DataFixTypes.m_264226_(DataFixTypes.java:49) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:mixin,re:classloading,pl:mixin:APP:railways-common.mixins.json:MixinDataFixTypes,pl:mixin:A}
	at net.minecraft.util.datafix.DataFixTypes.m_264218_(DataFixTypes.java:53) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:mixin,re:classloading,pl:mixin:APP:railways-common.mixins.json:MixinDataFixTypes,pl:mixin:A}
	at net.minecraft.client.Options.m_92164_(Options.java:1159) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:kubejs-common.mixins.json:OptionsMixin,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins/common/nochatreports.mixins.json:client.MixinOptions,pl:mixin:APP:prometheus-common.mixins.json:client.OptionsMixin,pl:mixin:APP:fancymenu.mixins.json:client.IMixinOptions,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.Options.load(Options.java:1050) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:kubejs-common.mixins.json:OptionsMixin,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins/common/nochatreports.mixins.json:client.MixinOptions,pl:mixin:APP:prometheus-common.mixins.json:client.OptionsMixin,pl:mixin:APP:fancymenu.mixins.json:client.IMixinOptions,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.Options.m_92140_(Options.java:1028) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:kubejs-common.mixins.json:OptionsMixin,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins/common/nochatreports.mixins.json:client.MixinOptions,pl:mixin:APP:prometheus-common.mixins.json:client.OptionsMixin,pl:mixin:APP:fancymenu.mixins.json:client.IMixinOptions,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.Options.<init>(Options.java:888) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinOptions_Entrypoint,pl:mixin:APP:kubejs-common.mixins.json:OptionsMixin,pl:mixin:APP:mixins.oculus.fixes.maxfpscrash.json:MixinMaxFpsCrashFix,pl:mixin:APP:mixins/common/nochatreports.mixins.json:client.MixinOptions,pl:mixin:APP:prometheus-common.mixins.json:client.OptionsMixin,pl:mixin:APP:fancymenu.mixins.json:client.IMixinOptions,pl:mixin:APP:mixins.oculus.json:sky.MixinOptions_CloudsOverride,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.<init>(Minecraft.java:425) ~[client-1.20.1-20230612.114412-srg.jar%23414!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:MinecraftClientMixin,pl:mixin:APP:modernfix-common.mixins.json:bugfix.concurrency.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:bugfix.world_leaks.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:perf.blast_search_trees.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:feature.measure_time.MinecraftMixin,pl:mixin:APP:modernfix-forge.mixins.json:feature.measure_time.MinecraftMixin_Forge,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:railways-common.mixins.json:conductor_possession.MixinMinecraft,pl:mixin:APP:konkrete.mixin.json:MixinMinecraft,pl:mixin:APP:mixins.oculus.json:MixinMinecraft_PipelineManagement,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:ae2.mixins.json:PickColorMixin,pl:mixin:APP:emi.mixins.json:MinecraftClientMixin,pl:mixin:APP:configuration.mixins.json:MinecraftMixin,pl:mixin:APP:mixins/common/nochatreports.mixins.json:client.MixinMinecraft,pl:mixin:APP:flywheel.mixins.json:PausedPartialTickAccessor,pl:mixin:APP:prometheus-common.mixins.json:client.accessors.MinecraftAccessor,pl:mixin:APP:fancymenu.mixins.json:client.IMixinMinecraft,pl:mixin:APP:fancymenu.mixins.json:client.MixinMinecraft,pl:mixin:APP:create.mixins.json:client.WindowResizeMixin,pl:mixin:APP:embeddium.mixins.json:core.render.MinecraftAccessor,pl:mixin:APP:embeddium.mixins.json:core.MinecraftClientMixin,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:182) ~[minecraft-1.20.1-client.jar:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:flywheel.mixins.json:ClientMainMixin,pl:mixin:A,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
	at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:111) ~[fmlloader-1.20.1-47.2.17.jar:?] {}
	at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:99) ~[fmlloader-1.20.1-47.2.17.jar:?] {}
	at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$makeService$0(CommonClientLaunchHandler.java:25) ~[fmlloader-1.20.1-47.2.17.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:108) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
	at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:67) ~[?:?] {}
	at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:88) ~[?:?] {}
	at org.prismlauncher.EntryPoint.listen(EntryPoint.java:126) ~[?:?] {}
	at org.prismlauncher.EntryPoint.main(EntryPoint.java:71) ~[?:?] {}
commented

I found a way around this bug. Add the version field in the options.txt file to defaultoptions.txt. In my case it was version:3120. This stops the options from being datafixed, which is where the error is encountered.