Create

Create

86M Downloads

Mysterious Crafting Troubles - KubeJS, JEI

FooterManDev opened this issue ยท 3 comments

commented

Describe the Bug

On the KubeJS: Create description it mentions how to make Mysterious Crafting entries in JEI. However, using this method does make an entry, but when leaving and then loading a world, it duplicates. I wasn't really sure if this was a Create bug or not, so I went to Latvian.dev's discord server and asked there. Seems it shouldn't be doing that based on the setup. I threw a log into the script and it logs only once, even after loading a world. I understand if this is not a Create bug and I'm just wasting your time, I just don't know.

Reproduction Steps

  1. Install Create, KubeJS, Rhino, KubeJS: Create, JEI (Or modpack Fun in the Sky).
  2. Load the game and create a script in the Kube client scripts folder with the code provided by KubeJS: Create's description (Changing "java" to "Java.loadClass").
  3. Load the game, see if a custom Conversion entry exists. If not, run /kubejs reload client_scripts and then run /reload and it'll pop up if done right.
  4. Exit the world and either load the same world or create a new one. There should be a duplicate entry.

Expected Result

No duplicate on world-load.

Screenshots and Videos

image

Code for Kube:
`let ConversionCategory = Java.loadClass('com.simibubi.create.compat.jei.category.MysteriousItemConversionCategory')
let ConversionRecipe = Java.loadClass('com.simibubi.create.compat.jei.ConversionRecipe')

ConversionCategory.RECIPES.add(ConversionRecipe.create('ae2:fluix_block', 'ae2:mysterious_cube'))`
Goes in .minecraft/kubejs/client_scripts

Crash Report or Log

https://gist.github.com/FooterMan15/fb19657ae93fb76aa70a27f16840986a

Operating System

Windows 11

Mod Version

0.5.0i

Minecraft Version

1.19.2

Forge Version

43.2.8

Other Mods

Many others in the Fun in the Sky modpack. A crude list of mods can be found here.

Additional Context

No response

commented

Yikes, that's not great. Thanks for letting me know, I assume there's no way around it then.

commented

Hi,
The list of 'conversion' recipes in create is hardcoded and doesnt clear itself. It only serves as a way to document in-world actions that are not data-driven.
Kube would have to remove its added recipes manually each reload, or stop supporting this category ๐Ÿ˜„

commented

Much like you call ConversionCategory.RECIPES.add(...)
in your client script you can call other java list operations just before that. This would be your workaround