Record Class SyncEventMessage
java.lang.Object
java.lang.Record
com.mrbysco.lunar.network.message.SyncEventMessage
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B extends net.minecraft.network.FriendlyByteBuf>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B extends net.minecraft.network.FriendlyByteBuf,T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf, SyncEventMessage> static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<SyncEventMessage> -
Constructor Summary
ConstructorsConstructorDescriptionSyncEventMessage(int color, String eventName, float scale, String moonTexture) SyncEventMessage(int color, String eventID, float moonScale, net.minecraft.resources.ResourceLocation customTexture) Creates an instance of aSyncEventMessagerecord class.SyncEventMessage(ILunarEvent event) SyncEventMessage(net.minecraft.network.FriendlyByteBuf buffer) -
Method Summary
Modifier and TypeMethodDescriptionintcolor()Returns the value of thecolorrecord component.net.minecraft.resources.ResourceLocationReturns the value of thecustomTexturerecord component.final booleanIndicates whether some other object is "equal to" this one.eventID()Returns the value of theeventIDrecord component.final inthashCode()Returns a hash code value for this object.floatReturns the value of themoonScalerecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type()voidwrite(net.minecraft.network.FriendlyByteBuf buffer)
-
Field Details
-
CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf,SyncEventMessage> CODEC -
ID
public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<SyncEventMessage> ID
-
-
Constructor Details
-
SyncEventMessage
-
SyncEventMessage
-
SyncEventMessage
public SyncEventMessage(net.minecraft.network.FriendlyByteBuf buffer) -
SyncEventMessage
public SyncEventMessage(int color, String eventID, float moonScale, net.minecraft.resources.ResourceLocation customTexture) Creates an instance of aSyncEventMessagerecord class.- Parameters:
color- the value for thecolorrecord componenteventID- the value for theeventIDrecord componentmoonScale- the value for themoonScalerecord componentcustomTexture- the value for thecustomTexturerecord component
-
-
Method Details
-
write
public void write(net.minecraft.network.FriendlyByteBuf buffer) -
type
public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type()- Specified by:
typein interfacenet.minecraft.network.protocol.common.custom.CustomPacketPayload
-
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 '=='. -
color
public int color()Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
eventID
Returns the value of theeventIDrecord component.- Returns:
- the value of the
eventIDrecord component
-
moonScale
public float moonScale()Returns the value of themoonScalerecord component.- Returns:
- the value of the
moonScalerecord component
-
customTexture
public net.minecraft.resources.ResourceLocation customTexture()Returns the value of thecustomTexturerecord component.- Returns:
- the value of the
customTexturerecord component
-