Jump to content

[1.14.4][Solved] Create recipes for machine with json


Recommended Posts

Posted
  On 10/1/2019 at 4:04 PM, Tieso2001 said:

What value?

Expand  
  On 10/1/2019 at 3:54 PM, Animefan8888 said:

Then use its constructor to initialize it.

Expand  

Basic Java.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 10/1/2019 at 4:13 PM, Tieso2001 said:

It needs IItemHandlerModifiable but inventory from my TileEntity is IItemHandler

Expand  

You use ItemStackHandler to initialize it though. And ItemStackHandler is dun dun dun a IItemHandlerModifiable instance. Therefore cast it.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 10/1/2019 at 4:15 PM, Animefan8888 said:

You use ItemStackHandler to initialize it though. And ItemStackHandler is dun dun dun a IItemHandlerModifiable instance. Therefore cast it.

Expand  

Okay, did that, that worked.

I can acces RecipeWrapper from my TileEntity, but what should I use as the second argument of RecipeManager#getRecipe.

Posted
  On 10/1/2019 at 4:24 PM, Tieso2001 said:

but what should I use as the second argument of RecipeManager#getRecipe.

Expand  

The second argument should be the RecipeWrapper field, and the first one should be your RecipeType.
 

  Quote

public static final IRecipeType<?> steeping = IRecipeType.register("steeping");

Expand  

Also instead of just "steeping" this should contain your modid.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)
  On 10/1/2019 at 4:29 PM, Animefan8888 said:

The second argument should be the RecipeWrapper field, and the first one should be your RecipeType.

Expand  

That doesn't work because recipeWrapper gives an error saying that it is the wrong type.

 

Edit: Apparantly there was something wrong with the recipeType which gave an error for both arguments

Edited by Tieso2001
Posted
  On 10/1/2019 at 4:31 PM, Tieso2001 said:

Edit: Apparantly there was something wrong with the recipeType which gave an error for both arguments

Expand  

I'm gonna need to see the line of code and the exact error. Unless this is you saying that you've solved it.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 10/1/2019 at 5:29 PM, Tieso2001 said:

Any idea what is wrong?

Expand  

test_steeping.json

  Quote

"ingredients": [

{

"item": "boneappletea:barley_grains"

}

]

Expand  

is not the same as

  Quote

JsonElement jsonelement = JSONUtils.isJsonArray(json, "ingredient") ? JSONUtils.getJsonArray(json, "ingredient") : JSONUtils.getJsonObject(json, "ingredient");

Expand  

Its also either a JsonArray or a JsonObject so in your Json you need to choose one.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 10/1/2019 at 5:39 PM, Animefan8888 said:

is not the same as

Expand  

Changed it in the json to ingredient.

 

Also I have a question:

public static final IRecipeType<SteepingRecipe> steeping = IRecipeType.register("steeping");

If I register the type like this, what does the type in the json have to be.

"minecraft:steeping",

"boneappletea:steeping",

or just "steeping"?

Posted
  On 10/1/2019 at 5:48 PM, Tieso2001 said:

If I register the type like this, what does the type in the json have to be.

Expand  

The IRecipeType is only used in code. The type in the Json refers to the registry name of the IRecipeSerializer.

  On 10/1/2019 at 5:48 PM, Tieso2001 said:

IRecipeType.register("steeping");

Expand  

As an extension. This will result in the IRecipeType being registered under minecraft:steeping which you don't want. Pass modid:steeping instead.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 10/1/2019 at 6:17 PM, Animefan8888 said:

The IRecipeType is only used in code. The type in the Json refers to the registry name of the IRecipeSerializer.

As an extension. This will result in the IRecipeType being registered under minecraft:steeping which you don't want. Pass modid:steeping instead.

Expand  

Finally got it working. Thank you for the help.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.