Record Class ShapedCraftingRecipeDisplay
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.display.ShapedCraftingRecipeDisplay
- All Implemented Interfaces:
RecipeDisplay
public record ShapedCraftingRecipeDisplay(int width, int height, List<SlotDisplay> ingredients, SlotDisplay result, SlotDisplay craftingStation)
extends Record
implements RecipeDisplay
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.item.crafting.display.RecipeDisplay
RecipeDisplay.Type<T extends RecipeDisplay>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SlotDisplay
The field for thecraftingStation
record component.private final int
The field for theheight
record component.private final List
<SlotDisplay> The field for theingredients
record component.static final com.mojang.serialization.MapCodec
<ShapedCraftingRecipeDisplay> private final SlotDisplay
The field for theresult
record component.static final StreamCodec
<RegistryFriendlyByteBuf, ShapedCraftingRecipeDisplay> static final RecipeDisplay.Type
<ShapedCraftingRecipeDisplay> private final int
The field for thewidth
record component.Fields inherited from interface net.minecraft.world.item.crafting.display.RecipeDisplay
CODEC
-
Constructor Summary
ConstructorsConstructorDescriptionShapedCraftingRecipeDisplay
(int width, int height, List<SlotDisplay> ingredients, SlotDisplay result, SlotDisplay craftingStation) Creates an instance of aShapedCraftingRecipeDisplay
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecraftingStation
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
height()
Returns the value of theheight
record component.Returns the value of theingredients
record component.boolean
isEnabled
(FeatureFlagSet p_380274_) result()
Returns the value of theresult
record component.final String
toString()
Returns a string representation of this record class.type()
int
width()
Returns the value of thewidth
record component.
-
Field Details
-
width
private final int widthThe field for thewidth
record component. -
height
private final int heightThe field for theheight
record component. -
ingredients
The field for theingredients
record component. -
result
The field for theresult
record component. -
craftingStation
The field for thecraftingStation
record component. -
MAP_CODEC
-
STREAM_CODEC
-
TYPE
-
-
Constructor Details
-
ShapedCraftingRecipeDisplay
public ShapedCraftingRecipeDisplay(int width, int height, List<SlotDisplay> ingredients, SlotDisplay result, SlotDisplay craftingStation) Creates an instance of aShapedCraftingRecipeDisplay
record class.- Parameters:
width
- the value for thewidth
record componentheight
- the value for theheight
record componentingredients
- the value for theingredients
record componentresult
- the value for theresult
record componentcraftingStation
- the value for thecraftingStation
record component
-
-
Method Details
-
type
- Specified by:
type
in interfaceRecipeDisplay
-
isEnabled
- Specified by:
isEnabled
in interfaceRecipeDisplay
-
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 '=='. -
width
public int width()Returns the value of thewidth
record component.- Returns:
- the value of the
width
record component
-
height
public int height()Returns the value of theheight
record component.- Returns:
- the value of the
height
record component
-
ingredients
Returns the value of theingredients
record component.- Returns:
- the value of the
ingredients
record component
-
result
Returns the value of theresult
record component.- Specified by:
result
in interfaceRecipeDisplay
- Returns:
- the value of the
result
record component
-
craftingStation
Returns the value of thecraftingStation
record component.- Specified by:
craftingStation
in interfaceRecipeDisplay
- Returns:
- the value of the
craftingStation
record component
-