Record Class SpottingIconPacket
java.lang.Object
java.lang.Record
net.frozenblock.lib.spotting_icons.impl.SpottingIconPacket
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
public record SpottingIconPacket(int entityId, net.minecraft.resources.ResourceLocation texture, float startFade, float endFade, net.minecraft.resources.ResourceLocation restrictionID)
extends Record
implements 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, SpottingIconPacket> static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<SpottingIconPacket> -
Constructor Summary
ConstructorsConstructorDescriptionSpottingIconPacket(int entityId, net.minecraft.resources.ResourceLocation texture, float startFade, float endFade, net.minecraft.resources.ResourceLocation restrictionID) Creates an instance of aSpottingIconPacketrecord class.SpottingIconPacket(net.minecraft.network.FriendlyByteBuf buf) -
Method Summary
Modifier and TypeMethodDescriptionfloatendFade()Returns the value of theendFaderecord component.intentityId()Returns the value of theentityIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationReturns the value of therestrictionIDrecord component.floatReturns the value of thestartFaderecord component.net.minecraft.resources.ResourceLocationtexture()Returns the value of thetexturerecord component.final StringtoString()Returns a string representation of this record class.@NotNull net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<?> type()voidwrite(net.minecraft.network.FriendlyByteBuf buf)
-
Field Details
-
PACKET_TYPE
public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<SpottingIconPacket> PACKET_TYPE -
CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf,SpottingIconPacket> CODEC
-
-
Constructor Details
-
SpottingIconPacket
public SpottingIconPacket(net.minecraft.network.FriendlyByteBuf buf) -
SpottingIconPacket
public SpottingIconPacket(int entityId, net.minecraft.resources.ResourceLocation texture, float startFade, float endFade, net.minecraft.resources.ResourceLocation restrictionID) Creates an instance of aSpottingIconPacketrecord class.- Parameters:
entityId- the value for theentityIdrecord componenttexture- the value for thetexturerecord componentstartFade- the value for thestartFaderecord componentendFade- the value for theendFaderecord componentrestrictionID- the value for therestrictionIDrecord component
-
-
Method Details
-
write
public void write(net.minecraft.network.FriendlyByteBuf buf) -
type
@NotNull public @NotNull net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<?> 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 '=='. -
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-
texture
public net.minecraft.resources.ResourceLocation texture()Returns the value of thetexturerecord component.- Returns:
- the value of the
texturerecord component
-
startFade
public float startFade()Returns the value of thestartFaderecord component.- Returns:
- the value of the
startFaderecord component
-
endFade
public float endFade()Returns the value of theendFaderecord component.- Returns:
- the value of the
endFaderecord component
-
restrictionID
public net.minecraft.resources.ResourceLocation restrictionID()Returns the value of therestrictionIDrecord component.- Returns:
- the value of the
restrictionIDrecord component
-