Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello, I'm new to coding and modding and I'm need your help.

I'm trying to make simple recipe: shovel + gravel = flint and i get it working, but I wonder how to make that the shovel uses its durability when crafted.

I know that there is a post (http://www.minecraftforge.net/forum/topic/60481-112-creating-recipes-with-multiple-results/) which is something that I need, but I just not understand what is written there, so I need a bit more precision, I'll appreciate it. Thank you!

You need a custom IRecipe implementation (this will also require setting up a _factories.json file)

When you get to determineRemainingItems you leave the shovel (and damage it).

 

You can extend existing recipes and only override the single method.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
25 minutes ago, Draco18s said:

You need a custom IRecipe implementation (this will also require setting up a _factories.json file)

When you get to determineRemainingItems you leave the shovel (and damage it).

 

You can extend existing recipes and only override the single method.

So, how to actually implement custom IRecipe or at least look at the non custom one? I tried to google but find nothing. I checked that _factories.json and created somewhat similar, but what exactly should be in that class? Sorry for stupid questions

{
    "<type>": {
        "<name>": "<fully qualified classname for the specified type>"
    }
}
 
57 minutes ago, needle112 said:

how to actually implement custom IRecipe

In Java. Its a class. 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
20 minutes ago, Draco18s said:

In Java. Its a class. 

I understand that it is a class but what is should have in it?

It should either:

a) implement IRecipe (and implementing it will tell you exactly what methods you need because you'll get red lines and the auto-fix will create stub methods you will need to implement (write code for))

b) extend an existing implementation of IRecipe (and you will need to override one or more of those methods to do what you want, as I mentioned previously)

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
11 hours ago, Draco18s said:

It should either:

a) implement IRecipe (and implementing it will tell you exactly what methods you need because you'll get red lines and the auto-fix will create stub methods you will need to implement (write code for))

b) extend an existing implementation of IRecipe (and you will need to override one or more of those methods to do what you want, as I mentioned previously) 

As I understand I should parse  recipe Json to get ingredients and outputs and somehow change it but I don't know needed syntax and can't google it

I have that but still don't know what to do, sorry :(

public class JustRecipeFactory implements IRecipeFactory {

    @Override
    public IRecipe parse(JsonContext context, JsonObject json) {
        // TODO Auto-generated method stub
        //what should go here? :(
        
        return null;
    }

}

Edited by needle112

You need to parse the JSON.

See my example here:

https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/api/recipes/RecipeToolMold.java#L248-L265

You're going to largely need to figure this out for yourself based on existing examples.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.