Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4638

RecipeChoice.ExactChoice is being ignored resulting in wrong recipe output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • This server is running CraftBukkit version git-Spigot-e5e5c7c-c24abab (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT)
    • Yes

      There is a bug when adding new recipes with the 'draft api' ExactChoice.

       

      This only happens if the shape and materials of the ExactChoice matches with a vanilla recipe, even when the ItemStacks have custom meta. Then the vanilla result is being choosen and not the custom result.

       

      Example shape for a iron_sword:

      0A0       A = A itemstack with a custom displayname.

      0A0       S = A normal stick

      0S0        

       

      The Result is a iron sword with a custom name.

      All ingredients are registered via RecipeChoice.ExactChoice and ARE properly registered, the result pops up in the crafting book after a relog and I can unlock the recipe via the minecraft /recipe command.

       

      But what happens:

      When crafting the recipe, a normal iron sword pops up in the result, even when clicking on the recipe in the recipe book and the ExactChoice is completly ignored.

       

      What should happen:

      The custom itemstack that was registered should pop up and not the vanilla result.

       

      Example code:

       

       

      ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, "sword"), new ItemBuilder(Material.IRON_SWORD).name("§cCustom Sword").build()); 
      
      recipe.shape("0a0", "0a0", "0b0");
      recipe.setIngredient('a', new RecipeChoice.ExactChoice(new ItemBuilder(Material.IRON_INGOT).name("§7Custom Ingot").build()));
      recipe.setIngredient('b', new RecipeChoice.ExactChoice(new ItemStack(Material.STICK)));
      Bukkit.addRecipe(recipe);
      

       

       

      This crafting result should be the renamed item, but a vanilla sword appears instead, but the resulting item is correctly listed in my clients recipe book.

            Unassigned Unassigned
            crysis992 crysis992
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: