diff --git a/src/main/java/dev/latvian/mods/kubejs/script/KubeJSContext.java b/src/main/java/dev/latvian/mods/kubejs/script/KubeJSContext.java index 1b8c25c89..82ad51a0a 100644 --- a/src/main/java/dev/latvian/mods/kubejs/script/KubeJSContext.java +++ b/src/main/java/dev/latvian/mods/kubejs/script/KubeJSContext.java @@ -132,10 +132,10 @@ protected Object internalJsToJavaLast(Object from, TypeInfo target) { return k; } - var registry = lookupRegistry(target.param(0), from); + var registryType = lookupRegistryType(target.param(0), from); var id = ID.mc(from); - return ResourceKey.create(registry.key(), id); + return ResourceKey.create(registryType.key(), id); } else if (c == Holder.class) { return HolderWrapper.wrap(this, from, target.param(0)); } else if (c == HolderSet.class) {