Package org.cyclops.cyclopscore.helper
Class RecipeSerializerHelpers
java.lang.Object
org.cyclops.cyclopscore.helper.RecipeSerializerHelpers
Helpers related to recipe serialization.
-
Field Summary
Modifier and TypeFieldDescriptionstatic 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>>> static final net.minecraft.network.codec.StreamCodec
<net.minecraft.network.RegistryFriendlyByteBuf, com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack, ItemStackFromIngredient>> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.mojang.serialization.Codec
<ItemStackFromIngredient> getCodecItemStackFromIngredient
(Supplier<List<String>> modPriorities) static com.mojang.serialization.Codec
<com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack, ItemStackFromIngredient>> getCodecItemStackOrTag
(Supplier<List<String>> modPriorities) 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) static com.mojang.datafixers.util.Either
<net.minecraft.world.item.ItemStack, ItemStackFromIngredient> readItemStackOrItemStackIngredient
(net.minecraft.network.RegistryFriendlyByteBuf buffer) 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) static <T> Optional
<T> readOptionalFromNetwork
(net.minecraft.network.FriendlyByteBuf buffer, Function<net.minecraft.network.FriendlyByteBuf, T> readFromBuffer) static void
writeItemStackOrItemStackIngredient
(net.minecraft.network.RegistryFriendlyByteBuf buffer, com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack, ItemStackFromIngredient> itemStackOrItemStackIngredient) 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) static <T> void
writeOptionalToNetwork
(net.minecraft.network.FriendlyByteBuf buffer, Optional<T> value, BiConsumer<net.minecraft.network.FriendlyByteBuf, T> writeToBuffer)
-
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, STREAM_CODEC_ITEMSTACK_OR_TAGItemStackFromIngredient>> -
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, STREAM_CODEC_ITEMSTACK_OR_ITEMSTACKINGREDIENT_CHANCEFloat>, org.apache.commons.lang3.tuple.Pair<ItemStackFromIngredient, Float>>>
-
-
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
-
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>, readItemStackOrItemStackIngredientChanceorg.apache.commons.lang3.tuple.Pair<ItemStackFromIngredient, Float>> (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
-