Record Class ClientboundCustomSetTimePayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.ClientboundCustomSetTimePayload
- All Implemented Interfaces:
CustomPacketPayload
@Internal
public record ClientboundCustomSetTimePayload(long gameTime, long dayTime, boolean gameRule, float dayTimeFraction, float dayTimePerTick)
extends Record
implements CustomPacketPayload
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
CustomPacketPayload.FallbackProvider<B extends FriendlyByteBuf>, CustomPacketPayload.Type<T extends CustomPacketPayload>, CustomPacketPayload.TypeAndCodec<B extends FriendlyByteBuf,T extends CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longThe field for thedayTimerecord component.private final floatThe field for thedayTimeFractionrecord component.private final floatThe field for thedayTimePerTickrecord component.private final booleanThe field for thegameRulerecord component.private final longThe field for thegameTimerecord component.static final CustomPacketPayload.Type<ClientboundCustomSetTimePayload> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundCustomSetTimePayload(long gameTime, long dayTime, boolean gameRule, float dayTimeFraction, float dayTimePerTick) Creates an instance of aClientboundCustomSetTimePayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongdayTime()Returns the value of thedayTimerecord component.floatReturns the value of thedayTimeFractionrecord component.floatReturns the value of thedayTimePerTickrecord component.final booleanIndicates whether some other object is "equal to" this one.booleangameRule()Returns the value of thegameRulerecord component.longgameTime()Returns the value of thegameTimerecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
gameTime
private final long gameTimeThe field for thegameTimerecord component. -
dayTime
private final long dayTimeThe field for thedayTimerecord component. -
gameRule
private final boolean gameRuleThe field for thegameRulerecord component. -
dayTimeFraction
private final float dayTimeFractionThe field for thedayTimeFractionrecord component. -
dayTimePerTick
private final float dayTimePerTickThe field for thedayTimePerTickrecord component. -
TYPE
-
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf,ClientboundCustomSetTimePayload> STREAM_CODEC
-
-
Constructor Details
-
ClientboundCustomSetTimePayload
public ClientboundCustomSetTimePayload(long gameTime, long dayTime, boolean gameRule, float dayTimeFraction, float dayTimePerTick) Creates an instance of aClientboundCustomSetTimePayloadrecord class.- Parameters:
gameTime- the value for thegameTimerecord componentdayTime- the value for thedayTimerecord componentgameRule- the value for thegameRulerecord componentdayTimeFraction- the value for thedayTimeFractionrecord componentdayTimePerTick- the value for thedayTimePerTickrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceCustomPacketPayload
-
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 '=='. -
gameTime
public long gameTime()Returns the value of thegameTimerecord component.- Returns:
- the value of the
gameTimerecord component
-
dayTime
public long dayTime()Returns the value of thedayTimerecord component.- Returns:
- the value of the
dayTimerecord component
-
gameRule
public boolean gameRule()Returns the value of thegameRulerecord component.- Returns:
- the value of the
gameRulerecord component
-
dayTimeFraction
public float dayTimeFraction()Returns the value of thedayTimeFractionrecord component.- Returns:
- the value of the
dayTimeFractionrecord component
-
dayTimePerTick
public float dayTimePerTick()Returns the value of thedayTimePerTickrecord component.- Returns:
- the value of the
dayTimePerTickrecord component
-