Package com.mrbysco.spoiled.component
Record Class SpoilTimer
java.lang.Object
java.lang.Record
com.mrbysco.spoiled.component.SpoilTimer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SpoilTimer> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, SpoilTimer> -
Constructor Summary
ConstructorsConstructorDescriptionSpoilTimer(int maxTime) SpoilTimer(int timer, int maxTime) Creates an instance of aSpoilTimerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaxTime()Returns the value of themaxTimerecord component.inttimer()Returns the value of thetimerrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SpoilTimer> STREAM_CODEC
-
-
Constructor Details
-
SpoilTimer
public SpoilTimer(int maxTime) -
SpoilTimer
public SpoilTimer(int timer, int maxTime) Creates an instance of aSpoilTimerrecord class.- Parameters:
timer- the value for thetimerrecord componentmaxTime- the value for themaxTimerecord component
-
-
Method Details
-
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. All components in this record class are compared with '=='. -
timer
public int timer()Returns the value of thetimerrecord component.- Returns:
- the value of the
timerrecord component
-
maxTime
public int maxTime()Returns the value of themaxTimerecord component.- Returns:
- the value of the
maxTimerecord component
-