Record Class DoughData
java.lang.Object
java.lang.Record
com.petrolpark.compat.create.core.dough.DoughData
public record DoughData(IDough dough, float thickness, byte width, byte length, Neither<DoughData.Cuts,DoughData.Toppings> decoration, boolean madeByPlayer)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDoughData(IDough dough, float thickness, byte width, byte length, Neither<DoughData.Cuts, DoughData.Toppings> decoration, boolean madeByPlayer) Creates an instance of aDoughDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedecorationrecord component.dough()Returns the value of thedoughrecord component.final booleanIndicates whether some other object is "equal to" this one.forItem()If there are Toppings, preserves them.static final DoughDataget(net.minecraft.world.item.ItemStack stack) final inthashCode()Returns a hash code value for this object.booleanisRollable(boolean lengthwise) bytelength()Returns the value of thelengthrecord component.booleanReturns the value of themadeByPlayerrecord component.madeByPlayer(boolean madeByPlayer) floatrolled(boolean lengthwise, boolean byPlayer) rolled(byte width, byte length, boolean byPlayer) floatReturns the value of thethicknessrecord component.final StringtoString()Returns a string representation of this record class.bytewidth()Returns the value of thewidthrecord component.withNewTopping(DoughData.Toppings.Entry topping) withNewTopping(net.minecraft.core.Holder<IDoughTopping> topping) withoutTopping(net.minecraft.core.Holder<IDoughTopping> topping) withThickness(float thickness)
-
Field Details
-
MAX_WIDTH
public static final byte MAX_WIDTH- See Also:
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,DoughData> STREAM_CODEC
-
-
Constructor Details
-
DoughData
public DoughData(IDough dough, float thickness, byte width, byte length, Neither<DoughData.Cuts, DoughData.Toppings> decoration, boolean madeByPlayer) Creates an instance of aDoughDatarecord class.- Parameters:
dough- the value for thedoughrecord componentthickness- the value for thethicknessrecord componentwidth- the value for thewidthrecord componentlength- the value for thelengthrecord componentdecoration- the value for thedecorationrecord componentmadeByPlayer- the value for themadeByPlayerrecord component
-
-
Method Details
-
isRollable
public boolean isRollable(boolean lengthwise) -
rolled
-
rolled
-
forItem
If there are Toppings, preserves them. Otherwise, turns back into a single ball to be rolled again. -
remainingArea
public float remainingArea() -
withDough
-
withThickness
-
withNewTopping
-
withNewTopping
-
withoutTopping
-
madeByPlayer
-
get
-
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 '=='. -
dough
Returns the value of thedoughrecord component.- Returns:
- the value of the
doughrecord component
-
thickness
public float thickness()Returns the value of thethicknessrecord component.- Returns:
- the value of the
thicknessrecord component
-
width
public byte width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
length
public byte length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-
decoration
Returns the value of thedecorationrecord component.- Returns:
- the value of the
decorationrecord component
-
madeByPlayer
public boolean madeByPlayer()Returns the value of themadeByPlayerrecord component.- Returns:
- the value of the
madeByPlayerrecord component
-