Jump to content

Hook to check the place where the crafting happens BEFORE it happens


Recommended Posts

Posted

I am the developer of the ResearchCraft mod, and while making the mod I found that I needed a small hook to check the position before the crafting happens. This would help me to finish the mod and might help others who want some recipe to be used only under certain circumstances, like for example a recipe to make ice from a water bucket. That recipe would be disabled unless the crafting occurs in a snow biome.

 

Ok, so I have the hook here, this is what I want it to be like.

Look at it and say if you like it or the coding is awful and must be replaced by some better code:

 

ICraftingHandler.java: with onTakenFromCrafting.

 

  Reveal hidden contents

 

 

ForgeHooks.java: after or before onTakenFromCrafting.

 

  Reveal hidden contents

 

 

CraftingManager: note that there is some code in the deprecated one.

 

  Reveal hidden contents

 

 

Now there are two base edits that aren't edited right now by forge. You'll not like this. :(

 

ContainerPlayer:

 

  Reveal hidden contents

 

 

ContainerWorkbench:

 

  Reveal hidden contents

 

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.