#Details about "event.recipes"
21 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
The event in ServerEvent.recipes callback is an instance of RecipesEventJS
Also, that's not an attribute, that's a bean.
AKA - KubeJS transformed getRecipes method into a JS accessor property containing only a getter for recipes.
From the code, the type you get is Map<String, Object>, so String keys and any Java object values
I see, thank you. That means, I'll need some casting shenanigans :3
Ticket re-opened!
BTW - what are you trying to do?
Because that may be an XY problem
The XY problem is when you really want to do X, and you think that Y can achieve X. However, you can't get Y to work, and so ask for help exclusively about Y.
This can lead to a lot of confusion from the people trying to help you, as Y can seem like a very random thing to want to do, and a lot of the time isn't the best way to achieve X anyway.
Its fine to ask about Y, just always include some context about X so you can be put on the right track if Y won't do X well, or there is an easier way to do X.
the thing is, that I want to do everything which does not need to be reloaded constantly in java, while still have kube's flexibility at hand
the problem boiled down to getting a Consumer<FinishedRecipe> to work at a specific point
The recipes getter gives a map of known, documented recipes, so as a part of a call like this:
event.recipes.create.mechanical_crafting()
meaning, that I can add a key-value pair to that map where the recipe is the value and have it added?
probably not 😂
what I did now, is printing the values of the map given by event.recipes. this gave prints like gtceu:chemical_reactor
looks like a resource location of a recipe type to me
will try what the keys and values of event.recipes.gtceu.chemical_reactor() look like
I can't because the map is null
although the object itself is not null
it might work, if I would have access to the map Map<ResourceLocation, Recipe<?>> recipesByName which is passed to the injectRuntimeRecipes method of kjs plugins