KubeJS

KubeJS

69M Downloads

Custom Ingredients do not work

ChiefArug opened this issue ยท 2 comments

commented

Minecraft Version

1.19.2

KubeJS Version

4577b0d

Rhino Version

1902.2.2-build.268

Architectury Version

6.5.82

Forge/Fabric Version

43.2.11

Describe your issue

Custom ingredients, including Ingredient#custom and Ingredient#customNBT do not work because of this line:


It sets isServer to false, which is then checked when the ingredient is tested, and the ingredient returns false without actually invoking the custom test.

From my debugging it seems that the ingredient parsed from JSON is the only ingredient to ever be tested. The testing does happen on the server thread tho.

Im not sure what purpose this isServer set in the json constructor serves, does recipe json parsing really only happen on the client???

Crash report/logs

No response

commented

This also causes issues with using custom predicates for item filtering in block entities, because that too uses Ingredient:

public void inventory(int width, int height, Ingredient inputFilter) {

commented

Someone needs to look into custom Ingredients again, their impl in general is just janky as hell