KubeJS

KubeJS

69M Downloads

ServerJS.getWorld() / getLevel() always reports ambiguous argument types

Vosty opened this issue ยท 0 comments

commented

Minecraft Version

1.18.1

KubeJS Version

1801.4.2-build-298

Rhino Version

1801.1.8-build.99

Architectury Version

3.6.16

Forge/Fabric Version

Forge 39.0.59

Describe your issue

image

image

I'm using KubeJS to make my own chat based waystones/teleportation system. The details of that don't really matter, i just included the screenshots to show you that I'm dealing with a valid event object here. The code gets as far as to calling getNearbySafeSpot() then dies in the first line

When trying to call ServerJS.getWorld(), kubeJS gets tripped up by the overloaded method, and displays the following error

[20:48:22] [Server thread/ERROR]: Error occurred while handling event 'player.chat': The choice of Java method dev.latvian.mods.kubejs.server.ServerJS.getWorld matching JavaScript argument types (java.lang.String) is ambiguous; candidate methods are: 
    class dev.latvian.mods.kubejs.level.LevelJS getWorld(net.minecraft.world.level.Level)
    class dev.latvian.mods.kubejs.level.LevelJS getWorld(java.lang.String) (server_scripts:waymark.js#133)

The same is also true for getLevel()

[21:15:59] [Server thread/ERROR]: Error occurred while handling event 'player.chat': The choice of Java method dev.latvian.mods.kubejs.server.ServerJS.getLevel matching JavaScript argument types (java.lang.String) is ambiguous; candidate methods are: 
    class dev.latvian.mods.kubejs.level.LevelJS getLevel(java.lang.String)
    class dev.latvian.mods.kubejs.level.LevelJS getLevel(net.minecraft.world.level.Level) (server_scripts:waymark.js#133)

Obviously, as the error message shows, I am calling this with a String, but it can't figure it out.
Searching on the discord revealed that this was a currently unsubmitted bug,
image
so, here I am, submitting it :)

Crash report/logs

No response