Jump to content

Help with my Recipe


Dr.Nickenstein

Recommended Posts

So I was creating a recipe, and now I have no errors in my code. But it still doesn't work for some reason, could you help me find the error? I'll provide my classes:

ISculptorRecipe (Recipe interface): https://pastebin.com/rX7c0wJP

SculptorRecipe (Recipe class): https://pastebin.com/fkfG41MJ

SculptorRecipeSerializer: (Recipe serializer): https://pastebin.com/kNPgSxcC

RecipeSerializerInit (Initializator for the serializer): https://pastebin.com/ZdfWNWyC

SculptorItemHandler (Item handler for the tile entity): https://pastebin.com/mp2vWqKs

pure_flux_crystal.json (Recipe file): https://pastebin.com/8n4uiHFG

 

Thank you in advance.

Link to comment
Share on other sites

3 minutes ago, diesieben07 said:

This bypasses the whole concept of DeferredRegister. You must create your registry entries inside the supplier you give to DeferredRegister#register.

 

You register an IRecipeType twice. Once in RecipeSerializerInit and once in ISculptorRecipe.

So it should look like this?:

 

public static final DeferredRegister<IRecipeSerializer<?>> RECIPE_SERIALIZERS = DeferredRegister.create( ForgeRegistries.RECIPE_SERIALIZERS, Humlands.MOD_ID);

public static final RegistryObject<IRecipeSerializer<?>> SCULPTOR_SERIALIZER = RECIPE_SERIALIZERS.register("sculptor", () -> new SculptorRecipeSerializer());

Link to comment
Share on other sites

8 minutes ago, Dr.Nickenstein said:

If you mean the duplicate recipe type, yes. I have removed the field in the Init

did you added the registration to your mod class constructor like this:

yourClass.RECIPE_SERIALIZERS.register(FMLJavaModLoadingContext.get().getModEventBus());

 

Edited by Luis_ST
Link to comment
Share on other sites

1 minute ago, diesieben07 said:

Nothing in your code even attempts to process the input item in your inventory. You made some methods in your TileEntity that find the matching recipe, but you never use them.

Also, do not create the LazyOptional every time in getCapability, create it once and store it in a field.

So what should I do?

Link to comment
Share on other sites

1 minute ago, diesieben07 said:

If you don't know then you need to decide.

You made an inventory with two slots. That means you now have slot indices 0 and 1. You are the only person that can decide which is which. Pick one and act accordingly.

So I shouldn't create a variable or anything, I just need to keep it in my mind?

Link to comment
Share on other sites

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.