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
Modifier and TypeFieldDescriptionprivate final long
The field for thedayTime
record component.private final float
The field for thedayTimeFraction
record component.private final float
The field for thedayTimePerTick
record component.private final boolean
The field for thegameRule
record component.private final long
The field for thegameTime
record component.static final CustomPacketPayload.Type
<ClientboundCustomSetTimePayload> -
Constructor Summary
ConstructorDescriptionClientboundCustomSetTimePayload
(long gameTime, long dayTime, boolean gameRule, float dayTimeFraction, float dayTimePerTick) Creates an instance of aClientboundCustomSetTimePayload
record class. -
Method Summary
Modifier and TypeMethodDescriptionlong
dayTime()
Returns the value of thedayTime
record component.float
Returns the value of thedayTimeFraction
record component.float
Returns the value of thedayTimePerTick
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
gameRule()
Returns the value of thegameRule
record component.long
gameTime()
Returns the value of thegameTime
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.type()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
gameTime
private final long gameTimeThe field for thegameTime
record component. -
dayTime
private final long dayTimeThe field for thedayTime
record component. -
gameRule
private final boolean gameRuleThe field for thegameRule
record component. -
dayTimeFraction
private final float dayTimeFractionThe field for thedayTimeFraction
record component. -
dayTimePerTick
private final float dayTimePerTickThe field for thedayTimePerTick
record 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 aClientboundCustomSetTimePayload
record class.- Parameters:
gameTime
- the value for thegameTime
record componentdayTime
- the value for thedayTime
record componentgameRule
- the value for thegameRule
record componentdayTimeFraction
- the value for thedayTimeFraction
record componentdayTimePerTick
- the value for thedayTimePerTick
record component
-
-
Method Details
-
type
- Specified by:
type
in 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 thegameTime
record component.- Returns:
- the value of the
gameTime
record component
-
dayTime
public long dayTime()Returns the value of thedayTime
record component.- Returns:
- the value of the
dayTime
record component
-
gameRule
public boolean gameRule()Returns the value of thegameRule
record component.- Returns:
- the value of the
gameRule
record component
-
dayTimeFraction
public float dayTimeFraction()Returns the value of thedayTimeFraction
record component.- Returns:
- the value of the
dayTimeFraction
record component
-
dayTimePerTick
public float dayTimePerTick()Returns the value of thedayTimePerTick
record component.- Returns:
- the value of the
dayTimePerTick
record component
-