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

Custom ShapedCraft bug when custom ingredients

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • 1.17
    • Yes

      Hello, i found a bug when creating a ShapedRecipe and using RecipeChoice.ExactChoice.

       

      If you use Itemstack with custom ItemMeta as ingredients, your craft will work, but the "preview craft" in the craft book will not.

       

      I recommend you to watch the video attached to better understand.

      Minecraft_2021.11.11_-_13.07.25.09.DVR_Trim.mp4

       

      I don't know from where it can came.

       

       

      Edit : Another basic example with a video in attachment too.

      Minecraft 2021.11.15 - 10.55.43.04.DVR_Trim.mp4

       

      final ItemStack item = new ItemStack(Material.STICK);
      final NamespacedKey key = new NamespacedKey(main, "testttt");
      final ShapedRecipe recipe = new ShapedRecipe(key, item);
      recipe.shape(" E ", " E ", " E ");
      
      final ItemStack ingredient = new ItemStack(Material.STICK);
      final ItemMeta itemMeta = ingredient.getItemMeta();
      itemMeta.setDisplayName("test");
      ingredient.setItemMeta(itemMeta);
      final RecipeChoice.ExactChoice choice = new RecipeChoice.ExactChoice(ingredient);
      recipe.setIngredient('E', choice);
      Bukkit.addRecipe(recipe);

            Unassigned Unassigned
            Kolight Kolight
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: