Record Class LocalRecipeData
java.lang.Object
java.lang.Record
com.example.uselocalrecipes.recipe.LocalRecipeData
-
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
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-