Class CraftingHelper

java.lang.Object
io.github.vampirestudios.vampirelib.crafting.CraftingHelper

public class CraftingHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    areShareTagsEqual(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.ItemStack other)
    Modeled after ItemStack.areItemStackTagsEqual Uses Item.getNBTShareTag for comparison instead of NBT and capabilities.
    static Predicate<com.google.gson.JsonObject>
    getConditionPredicate(com.google.gson.JsonObject json)
     
    static @Nullable net.minecraft.resources.ResourceLocation
    getID(io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer serializer)
     
    static net.minecraft.world.item.Item
    getItem(String itemName, boolean disallowsAirInRecipe)
     
    static net.minecraft.world.item.ItemStack
    getItemStack(com.google.gson.JsonObject json, boolean readNBT)
     
    static net.minecraft.world.item.ItemStack
    getItemStack(com.google.gson.JsonObject json, boolean readNBT, boolean disallowsAirInRecipe)
     
    static net.minecraft.nbt.CompoundTag
    getNBT(com.google.gson.JsonElement element)
     
    static void
     
    static net.minecraft.world.item.crafting.Ingredient
    merge(Collection<net.minecraft.world.item.crafting.Ingredient> parts)
     
    static io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer
    register(net.minecraft.resources.ResourceLocation key, io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer serializer)
     
    static @Nullable net.minecraft.world.item.Item
    tryGetItem(String itemName, boolean disallowsAirInRecipe)
     
    static @Nullable net.minecraft.world.item.ItemStack
    tryGetItemStack(com.google.gson.JsonObject json, boolean readNBT, boolean disallowsAirInRecipe)
     
    static @Nullable net.minecraft.nbt.CompoundTag
    tryGetNBT(com.google.gson.JsonElement element)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CraftingHelper

      public CraftingHelper()
  • Method Details

    • init

      public static void init()
    • register

      public static io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer register(net.minecraft.resources.ResourceLocation key, io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer serializer)
    • getID

      @Nullable public static @Nullable net.minecraft.resources.ResourceLocation getID(io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer serializer)
    • getItemStack

      public static net.minecraft.world.item.ItemStack getItemStack(com.google.gson.JsonObject json, boolean readNBT)
    • getItem

      public static net.minecraft.world.item.Item getItem(String itemName, boolean disallowsAirInRecipe)
    • tryGetItem

      @Nullable public static @Nullable net.minecraft.world.item.Item tryGetItem(String itemName, boolean disallowsAirInRecipe)
    • getNBT

      public static net.minecraft.nbt.CompoundTag getNBT(com.google.gson.JsonElement element)
    • tryGetNBT

      @Nullable public static @Nullable net.minecraft.nbt.CompoundTag tryGetNBT(com.google.gson.JsonElement element)
    • getItemStack

      public static net.minecraft.world.item.ItemStack getItemStack(com.google.gson.JsonObject json, boolean readNBT, boolean disallowsAirInRecipe)
    • tryGetItemStack

      @Nullable public static @Nullable net.minecraft.world.item.ItemStack tryGetItemStack(com.google.gson.JsonObject json, boolean readNBT, boolean disallowsAirInRecipe)
    • merge

      public static net.minecraft.world.item.crafting.Ingredient merge(Collection<net.minecraft.world.item.crafting.Ingredient> parts)
    • areShareTagsEqual

      public static boolean areShareTagsEqual(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.ItemStack other)
      Modeled after ItemStack.areItemStackTagsEqual Uses Item.getNBTShareTag for comparison instead of NBT and capabilities. Only used for comparing itemStacks that were transferred from server to client using Item.getNBTShareTag.
    • getConditionPredicate

      public static Predicate<com.google.gson.JsonObject> getConditionPredicate(com.google.gson.JsonObject json)