Record Class LocalRecipeData
java.lang.Object
java.lang.Record
com.example.uselocalrecipes.recipe.LocalRecipeData
public record LocalRecipeData(net.minecraft.world.item.crafting.RecipeMap recipes, int fileCount, int failedCount, List<net.minecraft.core.Registry.PendingTags<?>> pendingTags)
extends Record
Result of reading the recipes that are available on the client machine.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocalRecipeData(net.minecraft.world.item.crafting.RecipeMap recipes, int fileCount, int failedCount, List<net.minecraft.core.Registry.PendingTags<?>> pendingTags) Creates an instance of aLocalRecipeDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidMust run on the client thread before the recipes reach the viewers, otherwise tag based ingredients fail.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefailedCountrecord component.intReturns the value of thefileCountrecord component.final inthashCode()Returns a hash code value for this object.List<net.minecraft.core.Registry.PendingTags<?>> Returns the value of thependingTagsrecord component.net.minecraft.world.item.crafting.RecipeMaprecipes()Returns the value of therecipesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
LocalRecipeData
public LocalRecipeData(net.minecraft.world.item.crafting.RecipeMap recipes, int fileCount, int failedCount, List<net.minecraft.core.Registry.PendingTags<?>> pendingTags) Creates an instance of aLocalRecipeDatarecord class.- Parameters:
recipes- the value for therecipesrecord componentfileCount- the value for thefileCountrecord componentfailedCount- the value for thefailedCountrecord componentpendingTags- the value for thependingTagsrecord component
-
-
Method Details
-
applyPendingTags
public void applyPendingTags()Must run on the client thread before the recipes reach the viewers, otherwise tag based ingredients fail. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
recipes
public net.minecraft.world.item.crafting.RecipeMap recipes()Returns the value of therecipesrecord component.- Returns:
- the value of the
recipesrecord component
-
fileCount
public int fileCount()Returns the value of thefileCountrecord component.- Returns:
- the value of the
fileCountrecord component
-
failedCount
public int failedCount()Returns the value of thefailedCountrecord component.- Returns:
- the value of the
failedCountrecord component
-
pendingTags
Returns the value of thependingTagsrecord component.- Returns:
- the value of the
pendingTagsrecord component
-