Class CustomBrewRecipeRegister
java.lang.Object
me.emafire003.dev.custombrewrecipes.CustomBrewRecipeRegister
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequalsNbt(net.minecraft.item.ItemStack item, net.minecraft.item.Item recipe_item, @Nullable net.minecraft.nbt.NbtElement recipe_nbt_value, @Nullable String recipe_nbt_field) Used to check if an itemstack and an item share the same NBT data.static booleanequalsNbt(net.minecraft.item.ItemStack recipe_item, net.minecraft.item.ItemStack item) Checks if two itemstacks have the same NBT.static List<CustomBrewRecipeRegister.CustomRecipe<net.minecraft.item.Item>>static booleanisValidCustomInput(net.minecraft.item.ItemStack item) Used (internally) to check if an item is a valid input/base, like a bottle or an akward potion.static voidregisterCustomRecipe(net.minecraft.item.Item input, net.minecraft.item.Item ingredient, net.minecraft.item.Item output) Use this method to register new recipes using custom items!static voidregisterCustomRecipeFieldOnlyNbt(net.minecraft.item.Item input, net.minecraft.item.Item ingredient, net.minecraft.item.Item output, @Nullable String input_nbt_field, @Nullable String ingredient_nbt_field, @Nullable net.minecraft.nbt.NbtCompound output_nbt) Use this method to register new recipes using custom items.static voidregisterCustomRecipeNbt(net.minecraft.item.Item input, net.minecraft.item.Item ingredient, net.minecraft.item.Item output, @Nullable net.minecraft.nbt.NbtCompound input_nbt, @Nullable net.minecraft.nbt.NbtCompound ingredient_nbt, @Nullable net.minecraft.nbt.NbtCompound output_nbt) Use this method to register new recipes using custom items.static voidregisterCustomRecipeNbt(net.minecraft.item.ItemStack input, net.minecraft.item.ItemStack ingredient, net.minecraft.item.ItemStack output) Use this method to register new recipes using custom items!static voidregisterCustomRecipeNbtField(net.minecraft.item.Item input, net.minecraft.item.Item ingredient, net.minecraft.item.Item output, @Nullable String input_nbt_field, @Nullable net.minecraft.nbt.NbtElement input_nbt_value, @Nullable String ingredient_nbt_field, @Nullable net.minecraft.nbt.NbtElement ingredient_nbt_value, @Nullable net.minecraft.nbt.NbtCompound output_nbt) Use this method to register new recipes using custom items.
-
Constructor Details
-
CustomBrewRecipeRegister
public CustomBrewRecipeRegister()
-
-
Method Details
-
registerCustomRecipe
public static void registerCustomRecipe(net.minecraft.item.Item input, net.minecraft.item.Item ingredient, net.minecraft.item.Item output) Use this method to register new recipes using custom items! Call this on initialization!- Parameters:
input- The input item, the "base" item like a water_bottle for normal recipesingredient- The ingredient item, like spider's eye, glowstone dust eccoutput- The output item, the one that will result from this recipe
-
registerCustomRecipeNbt
public static void registerCustomRecipeNbt(net.minecraft.item.Item input, net.minecraft.item.Item ingredient, net.minecraft.item.Item output, @Nullable @Nullable net.minecraft.nbt.NbtCompound input_nbt, @Nullable @Nullable net.minecraft.nbt.NbtCompound ingredient_nbt, @Nullable @Nullable net.minecraft.nbt.NbtCompound output_nbt) Use this method to register new recipes using custom items. This also supports nbt! Call this on initialization!- Parameters:
input- The input item, the "base" item like a water_bottle for normal recipesingredient- The ingredient item, like spider's eye, glowstone dust eccoutput- The output item, the one that will result from this recipeinput_nbt- An NBT compound that will be attached to the input item. Use null if you don't want to add NBT to this itemingredient_nbt- An NBT compound that will be attached to the ingredient item. Use null if you don't want to add NBT to this itemoutput_nbt- An NBT compound that will be attached to the output item. Use null if you don't want to add NBT to this item
-
registerCustomRecipeFieldOnlyNbt
public static void registerCustomRecipeFieldOnlyNbt(net.minecraft.item.Item input, net.minecraft.item.Item ingredient, net.minecraft.item.Item output, @Nullable @Nullable String input_nbt_field, @Nullable @Nullable String ingredient_nbt_field, @Nullable @Nullable net.minecraft.nbt.NbtCompound output_nbt) Use this method to register new recipes using custom items. This also supports nbt, but in a different way: it will check only for the presence of a field, and not its values. For example a Glass Bottle with an NBT field of "filledWith" might have values of "air", "water", "random_stuff" or whatever and still be valid. The output item will still need a nbt compound value thogh! Call this on initialization!- Parameters:
input- The input item, the "base" item like a water_bottle for normal recipesingredient- The ingredient item, like spider's eye, glowstone dust eccoutput- The output item, the one that will result from this recipeinput_nbt_field- A String that corresponds to a field that must be present on the item, regardless of its valueingredient_nbt_field- A String that corresponds to a field that must be present on the item, regardless of its valueoutput_nbt- An NBT compound that will be attached to the output item. Use null if you don't want to add NBT to this item
-
registerCustomRecipeNbtField
public static void registerCustomRecipeNbtField(net.minecraft.item.Item input, net.minecraft.item.Item ingredient, net.minecraft.item.Item output, @Nullable @Nullable String input_nbt_field, @Nullable @Nullable net.minecraft.nbt.NbtElement input_nbt_value, @Nullable @Nullable String ingredient_nbt_field, @Nullable @Nullable net.minecraft.nbt.NbtElement ingredient_nbt_value, @Nullable @Nullable net.minecraft.nbt.NbtCompound output_nbt) Use this method to register new recipes using custom items. This also supports nbt, but in a different way: it will check for the presence of a field, its values. For example a Glass Bottle with an NBT field of "filledWith" might have values of "air", "water", "random_stuff" or whatever and only "air" will be valid. If the NBT also contains other fieldds, they will be ignored. The output item will still need a nbt compound value! Call this on initialization!- Parameters:
input- The input item, the "base" item like a water_bottle for normal recipesingredient- The ingredient item, like spider's eye, glowstone dust eccoutput- The output item, the one that will result from this recipeinput_nbt_field- A String that corresponds to a field that must be present on the item, regardless of its valueinput_nbt_value- An NBTElement that will need to correspond the value stored inside the specified fieldingredient_nbt_field- A String that corresponds to a field that must be present on the item, regardless of its valueingredient_nbt_value- An NBTElement that will need to correspond the value stored inside the specified fieldoutput_nbt- An NBT compound that will be attached to the output item. Use null if you don't want to add NBT to this item
-
registerCustomRecipeNbt
public static void registerCustomRecipeNbt(net.minecraft.item.ItemStack input, net.minecraft.item.ItemStack ingredient, net.minecraft.item.ItemStack output) Use this method to register new recipes using custom items! This also supports nbt! Call this on initialization!- Parameters:
input- The input itemstack, the "base" item like a water_bottle for normal recipes. This should already have NBT set by you.ingredient- The ingredient itemstack, like spider's eye, glowstone dust ecc. This should already have NBT set by you.output- The output itemstack, the one that will result from this recipe. This should already have NBT set by you.
-
isValidCustomInput
public static boolean isValidCustomInput(net.minecraft.item.ItemStack item) Used (internally) to check if an item is a valid input/base, like a bottle or an akward potion. Also checks for nbt if necessary.- Parameters:
item- The item to test as a valid input- Returns:
- true if the item is a valid input
-
equalsNbt
public static boolean equalsNbt(net.minecraft.item.ItemStack recipe_item, net.minecraft.item.ItemStack item) Checks if two itemstacks have the same NBT. Or not, if they shouldn't have any NBT data -
equalsNbt
public static boolean equalsNbt(net.minecraft.item.ItemStack item, net.minecraft.item.Item recipe_item, @Nullable @Nullable net.minecraft.nbt.NbtElement recipe_nbt_value, @Nullable @Nullable String recipe_nbt_field) Used to check if an itemstack and an item share the same NBT data. This also applies to not having nbt data. This is also used to check if the itemstack has an NBT field present, but not necessarily have the same values as well- Parameters:
item- The itemstack that is used and should have nbt datarecipe_item- The item from the reciperecipe_nbt_value- An NBTElement value that will need to correspond either to the whole NBTCompound of the item, or to a value stored in a filed if the next parameter isn't nullrecipe_nbt_field- A String representing the field that has to be present on the item if the above parameter is null, or if isn't the filed to check the value of.- Returns:
- true if the item from the stack and the one from the recipe have the same nbt, or don't have nbt.
-
getCustomRecipes
public static List<CustomBrewRecipeRegister.CustomRecipe<net.minecraft.item.Item>> getCustomRecipes() -
getCustomRecipesNBTMap
-