GameRegistryEvent.Register<ShapedCraftingRecipe> not start:

[FR]
L’evenement ne démarre pas

[Google Translate]
The event does not start

@Listener
public void onWorldGeneratorModifierRegistrationRecipe(GameRegistryEvent.Register<ShapedCraftingRecipe> event) {
    logger.info("--");
    logger.info("");
    logger.info("GameRegistryEvent.Register<ShapedCraftingRecipe>");
    logger.info("");
    logger.info("--");

    Ingredient paper = Ingredient.of(ItemTypes.PAPER);
    Ingredient goldIngot = Ingredient.of(ItemTypes.GOLD_INGOT);
    Ingredient ironIngot = Ingredient.of(ItemTypes.IRON_INGOT);

    ItemType result1 = ItemTypes.BEDROCK;
    ShapedCraftingRecipe test0 = ShapedCraftingRecipe.builder()
            .rows()
            .row(ironIngot, goldIngot, ironIngot)
            .row(goldIngot, paper, goldIngot)
            .row(ironIngot, goldIngot, ironIngot)
            .result(ItemStack.of(result1, 32))
            .id(result1.getId().split(":")[1])
            .build();
    event.register(test0);
}

Pourquoi ? Just Enough Items (JEI) ne voit pas les craft aussi

Essaye plutôt avec GameRegistryEvent.Register<CraftingRecipe>.

Merci :), c’est bon^^

C’est normal que Just Enough Items (JEI) ne ne donne pas les craft ?

On peut obtenir la recette ? Je n’ai pas trouvé^^
CraftingRecipe recipe = Sponge.getRegistry().getCraftingRecipeRegistry().getById(“admintool:dynamite”).get();

merci

Pour JEI j’en n’ai pas la moindre idée, tu peux éventuellement créer un bug sur le github de SpongeForge.
Pour obtenir la recette, vérifie que tu as le bon id.

Je dois faire quoi exactement pour avoir la recette ? Je vois pas merci

Le type CraftingRecipe c’est la recette. Tu peux le cast en ShapedCraftingRecipe pour obtenir plus d’info dans ton cas ensuite tu peux récupérer les ingrédients via leur position getIngredient(x,y).

merci, je crois que c’est bon, dommage on peut pas faire:
conf.getConfig().getNode(“conf”, “test”).setValue(new TypeToken<ShapedCraftingRecipe>() {}, test2);