Jump to content

Recommended Posts

Posted

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.

Posted
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());

Posted (edited)
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
Posted
1 minute ago, diesieben07 said:

Post updated code, ideally a Git repo.

Just now, diesieben07 said:

 

I haven't got a github repository, but I have got github on my desktop. Do I send pastebins or create a git repository? (If so, how?)

Posted
1 minute ago, diesieben07 said:

Either works. A git repository is obviously more useful, as we can clone it and try out your code directly.

So I created the repository, but it's empty. How do I transfer my code in it?

Posted
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?

Posted
Just now, diesieben07 said:

In onContentsChagned you check if the slot that changed is the input slot. If it is, you output the output slot based on the matching recipe.

Yes but how do I check if it is the input slot. What number of slot is the input slot?

Posted
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?

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.