Class RecipeSerializerHelpers

java.lang.Object
org.cyclops.cyclopscore.helper.RecipeSerializerHelpers

public class RecipeSerializerHelpers extends Object
Helpers related to recipe serialization.
  • Field Details

    • STREAM_CODEC_ITEMSTACK_OR_TAG

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,ItemStackFromIngredient>> STREAM_CODEC_ITEMSTACK_OR_TAG
    • STREAM_CODEC_ITEMSTACK_OR_ITEMSTACKINGREDIENT_CHANCE

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,com.mojang.datafixers.util.Either<org.apache.commons.lang3.tuple.Pair<net.minecraft.world.item.ItemStack,Float>,org.apache.commons.lang3.tuple.Pair<ItemStackFromIngredient,Float>>> STREAM_CODEC_ITEMSTACK_OR_ITEMSTACKINGREDIENT_CHANCE
  • Constructor Details

    • RecipeSerializerHelpers

      public RecipeSerializerHelpers()
  • Method Details

    • getCodecItemStackFromIngredient

      public static com.mojang.serialization.Codec<ItemStackFromIngredient> getCodecItemStackFromIngredient(Supplier<List<String>> modPriorities)
    • getCodecItemStackOrTag

      public static com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,ItemStackFromIngredient>> getCodecItemStackOrTag(Supplier<List<String>> modPriorities)
    • getCodecItemStackOrTagChance

      public static com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<org.apache.commons.lang3.tuple.Pair<net.minecraft.world.item.ItemStack,Float>,org.apache.commons.lang3.tuple.Pair<ItemStackFromIngredient,Float>>> getCodecItemStackOrTagChance(Supplier<List<String>> modPriorities)
    • writeItemStackOrItemStackIngredient

      public static void writeItemStackOrItemStackIngredient(net.minecraft.network.RegistryFriendlyByteBuf buffer, com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,ItemStackFromIngredient> itemStackOrItemStackIngredient)
    • readItemStackOrItemStackIngredient

      public static com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,ItemStackFromIngredient> readItemStackOrItemStackIngredient(net.minecraft.network.RegistryFriendlyByteBuf buffer)
    • writeItemStackOrItemStackIngredientChance

      public static void writeItemStackOrItemStackIngredientChance(net.minecraft.network.RegistryFriendlyByteBuf buffer, com.mojang.datafixers.util.Either<org.apache.commons.lang3.tuple.Pair<net.minecraft.world.item.ItemStack,Float>,org.apache.commons.lang3.tuple.Pair<ItemStackFromIngredient,Float>> itemStackOrItemStackIngredient)
    • readItemStackOrItemStackIngredientChance

      public static com.mojang.datafixers.util.Either<org.apache.commons.lang3.tuple.Pair<net.minecraft.world.item.ItemStack,Float>,org.apache.commons.lang3.tuple.Pair<ItemStackFromIngredient,Float>> readItemStackOrItemStackIngredientChance(net.minecraft.network.RegistryFriendlyByteBuf buffer)
    • writeOptionalToNetwork

      public static <T> void writeOptionalToNetwork(net.minecraft.network.FriendlyByteBuf buffer, Optional<T> value, BiConsumer<net.minecraft.network.FriendlyByteBuf,T> writeToBuffer)
    • readOptionalFromNetwork

      public static <T> Optional<T> readOptionalFromNetwork(net.minecraft.network.FriendlyByteBuf buffer, Function<net.minecraft.network.FriendlyByteBuf,T> readFromBuffer)