Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysterious Crafting Troubles - KubeJS, JEI #5061

Open
FooterManDev opened this issue Jul 4, 2023 · 3 comments
Open

Mysterious Crafting Troubles - KubeJS, JEI #5061

FooterManDev opened this issue Jul 4, 2023 · 3 comments
Labels
type: bug Issue where something isn't working

Comments

@FooterManDev
Copy link

FooterManDev commented Jul 4, 2023

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

@FooterManDev FooterManDev added the type: bug Issue where something isn't working label Jul 4, 2023
@simibubi
Copy link
Collaborator

simibubi commented Jul 4, 2023

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 😄

@FooterManDev
Copy link
Author

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

@simibubi
Copy link
Collaborator

simibubi commented Jul 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issue where something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants