#Ambiguous function? Rhino plsss

11 messages · Page 1 of 1 (latest)

limpid onyx
#
ResourceKey[minecraft:worldgen/biome / minecraft:warped_forest] [net.minecraft.resources.ResourceKey]
Error occurred while handling event 'ftbquests.custom_reward': The choice of Java method net.minecraft.core.Holder$Reference.m_203373_ matching JavaScript argument types (net.minecraft.resources.ResourceKey) is ambiguous; candidate methods are:
    boolean m_203373_(net.minecraft.resources.ResourceLocation)
    boolean m_203565_(net.minecraft.resources.ResourceKey) (startup_scripts:custom_rewards.js#45)
biome = "warped_forest"
let biomeResourceKey = $ResourceKey.create(
  $Registry.BIOME_REGISTRY,
  biome
)
console.log(biomeResourceKey)
let found = serverLevel.findNearestBiome(
  (currentBiome) => currentBiome.is(biomeResourceKey),
    minecraftPlayer.getOnPos(),
    1024,
    4
  )

tried
currentBiome['m_203565_(net.minecraft.resources.ResourceKey)'](biomeResourceKey)
currentBiome['is(net.minecraft.resources.ResourceKey)'](biomeResourceKey)
currentBiome["boolean is(net.minecraft.resources.ResourceKey)"](biomeResourceKey)

and didn't work reeee

crude dewBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

limpid onyx
#

Object.keys()

[getClass,wait,tagKeys,notifyAll,bindTags,type,getTagKeys,notify,unwrap,bind,hashCode,unwrapKey,value,containsTag,class,key,kind,bound,is,validInRegistry,isValidInRegistry,tags,isBound,getType,equals,toString] [dev.latvian.mods.kubejs.util.ListJS]
#

JSON.stringify()

["class net.minecraft.core.Holder$Reference","java.lang.String ()","net.minecraft.core.Holder$Reference$Type ()","boolean is(net.minecraft.tags.TagKey)","java.util.stream.Stream tags()","boolean is(net.minecraft.resources.ResourceLocation)","boolean is(net.minecraft.resources.ResourceKey)","boolean is(java.util.function.Predicate)","com.mojang.datafixers.util.Either unwrap()","net.minecraft.core.Holder$Kind kind()","boolean isBound()","void bind(net.minecraft.resources.ResourceKey, java.lang.Object)","net.minecraft.resources.ResourceKey key()","void bindTags(java.util.Collection)","boolean isValidInRegistry(net.minecraft.core.Registry)","static net.minecraft.core.Holder$Reference createIntrusive(net.minecraft.core.Registry, java.lang.Object)","static net.minecraft.core.Holder$Reference createStandAlone(net.minecraft.core.Registry, net.minecraft.resources.ResourceKey)","java.util.Optional unwrapKey()","java.lang.Object value()","void (long, int)","void ()","native void (long)","boolean (java.lang.Object)","native int ()","native java.lang.Class ()","native void ()","native void ()","boolean (net.minecraft.tags.TagKey)","java.util.stream.Stream ()","boolean (net.minecraftforge.registries.tags.ITag)"]
#

currentBiome.is(biomeResourceKey.location())

works fine but...

limpid onyx
#

should work too pepethink

fluid bolt
#

Try using the predicate version.
It’s possible that it might not have issues with the ambiguousness of that

#
biome = "warped_forest"
let biomeResourceKey = $ResourceKey.create(
  $Registry.BIOME_REGISTRY,
  biome
)
console.log(biomeResourceKey)
let found = serverLevel.findNearestBiome(
  (currentBiome) => currentBiome.is((key)=> biomeResourceKey.isFor(key)),
    minecraftPlayer.getOnPos(),
    1024,
    4
  )