1.16.x Custom Crafting GUI

Discussion in 'Spigot Plugin Development' started by Shiny1Key, May 4, 2021.

  1. Well it would appear I spoke to soon. Why is this happening? Its matching parts of the recipe....

    upload_2021-5-4_20-32-2.png
     
  2. I am really at a loss. I seem to be so close and NONE of my matching code is working.

    Another issue im having is firing my event after the player drops an item into the invetory.....

    Anyone got ideas on better matching code and the listener I need for the inventory??
     
  3. I've done this before, and you're going to run into more problems than that. There are leftover ItemStacks in some recipes (cake turns milk buckets into empty buckets, for example). There is special click logic that you have to consider (shift-clicking a result into a partially full item slot). You have to respect other plugins that rely on PrepareItemCraftEvent/CraftItemEvent. And many other issues.

    My personal advice: Don't bother and go NMS. There's a lot of existing code that you can call there that already handles most of your issues. The method craft in CraftingManager will return whether an optional recipe. The method a in IRecipe will test a crafting input against that recipe and return all leftovers. You're also going to run into a few issues here, mainly with converting from your crafting table to the one recognized by NMS and back again, but it's - in my opinion - a lot easier than with only API methods.
     
  4. Well darn ok. Do you have any examples or something that can get me started? Im honestly not even sure where to start now if thats the case. I have spent a few hours looking through the forums and unless im missing something....no one really explains this stuff XD
     
  5. Or at this point....Anyone who wants to be hired to create the method.
     
  6. I have a few questions about your application.
    1. Are you intending to be able to craft everything which already exists as a vanilla recipe? Or, a limited list of Custom items only?
    2. Will you be crafting with a mix of vanilla and Custom items, or Custom items only?
     
  7. Vanilla and custom. Right now, the scope is just supporting all vanilla. Eventually I will add custom recipes