Search in sources :

Example 1 with RecipeSerializer

use of net.minecraft.world.item.crafting.RecipeSerializer in project MinecraftForge by MinecraftForge.

the class ForgeMod method registerRecipeSerialziers.

// ModBus, can't use addListener due to nested genetics.
@SubscribeEvent
public void registerRecipeSerialziers(RegistryEvent.Register<RecipeSerializer<?>> event) {
    CraftingHelper.register(AndCondition.Serializer.INSTANCE);
    CraftingHelper.register(FalseCondition.Serializer.INSTANCE);
    CraftingHelper.register(ItemExistsCondition.Serializer.INSTANCE);
    CraftingHelper.register(ModLoadedCondition.Serializer.INSTANCE);
    CraftingHelper.register(NotCondition.Serializer.INSTANCE);
    CraftingHelper.register(OrCondition.Serializer.INSTANCE);
    CraftingHelper.register(TrueCondition.Serializer.INSTANCE);
    CraftingHelper.register(TagEmptyCondition.Serializer.INSTANCE);
    CraftingHelper.register(new ResourceLocation("forge", "compound"), CompoundIngredient.Serializer.INSTANCE);
    CraftingHelper.register(new ResourceLocation("forge", "nbt"), NBTIngredient.Serializer.INSTANCE);
    CraftingHelper.register(new ResourceLocation("minecraft", "item"), VanillaIngredientSerializer.INSTANCE);
    event.getRegistry().register(new ConditionalRecipe.Serializer<Recipe<?>>().setRegistryName(new ResourceLocation("forge", "conditional")));
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) VanillaIngredientSerializer(net.minecraftforge.common.crafting.VanillaIngredientSerializer) ArgumentSerializer(net.minecraft.commands.synchronization.ArgumentSerializer) EmptyArgumentSerializer(net.minecraft.commands.synchronization.EmptyArgumentSerializer) GlobalLootModifierSerializer(net.minecraftforge.common.loot.GlobalLootModifierSerializer) RecipeSerializer(net.minecraft.world.item.crafting.RecipeSerializer) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Aggregations

ArgumentSerializer (net.minecraft.commands.synchronization.ArgumentSerializer)1 EmptyArgumentSerializer (net.minecraft.commands.synchronization.EmptyArgumentSerializer)1 ResourceLocation (net.minecraft.resources.ResourceLocation)1 RecipeSerializer (net.minecraft.world.item.crafting.RecipeSerializer)1 VanillaIngredientSerializer (net.minecraftforge.common.crafting.VanillaIngredientSerializer)1 GlobalLootModifierSerializer (net.minecraftforge.common.loot.GlobalLootModifierSerializer)1 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)1