Record Class ScreenEffectPayload
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.internal.effect.ScreenEffectPayload
- Record Components:
ticks- the duration ofScreenEffectPayload.Action.ENABLE_FORandScreenEffectPayload.Action.TINT, or of the transition ofScreenEffectPayload.Action.SET_STRENGTHandScreenEffectPayload.Action.SET_UNIFORM(0 for instant)uniform- the uniformScreenEffectPayload.Action.SET_UNIFORMchanges, empty otherwisevalues- the strength (first value) or uniform components
- All Implemented Interfaces:
CustomPacketPayload
public record ScreenEffectPayload(net.minecraft.resources.ResourceLocation effect, ScreenEffectPayload.Action action, int ticks, String uniform, float[] values)
extends Record
implements CustomPacketPayload
The server telling a client what to do with one of its registered screen effects.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.ixdarklord.coolcatcore.api.network.CustomPacketPayload
CustomPacketPayload.Type<T extends CustomPacketPayload>, CustomPacketPayload.TypeAndCodec<B extends io.netty.buffer.ByteBuf,T extends CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StreamCodec<net.minecraft.network.FriendlyByteBuf,ScreenEffectPayload> static final CustomPacketPayload.Type<ScreenEffectPayload> -
Constructor Summary
ConstructorsConstructorDescriptionScreenEffectPayload(net.minecraft.resources.ResourceLocation effect, ScreenEffectPayload.Action action, int ticks, String uniform, float[] values) Creates an instance of aScreenEffectPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.net.minecraft.resources.ResourceLocationeffect()Returns the value of theeffectrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intticks()Returns the value of theticksrecord component.final StringtoString()Returns a string representation of this record class.CustomPacketPayload.Type<? extends CustomPacketPayload>type()uniform()Returns the value of theuniformrecord component.float[]values()Returns the value of thevaluesrecord component.
-
Field Details
-
TYPE
-
STREAM_CODEC
public static final StreamCodec<net.minecraft.network.FriendlyByteBuf,ScreenEffectPayload> STREAM_CODEC
-
-
Constructor Details
-
ScreenEffectPayload
public ScreenEffectPayload(net.minecraft.resources.ResourceLocation effect, ScreenEffectPayload.Action action, int ticks, String uniform, float[] values) Creates an instance of aScreenEffectPayloadrecord class.
-
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
effect
public net.minecraft.resources.ResourceLocation effect()Returns the value of theeffectrecord component.- Returns:
- the value of the
effectrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
ticks
public int ticks()Returns the value of theticksrecord component.- Returns:
- the value of the
ticksrecord component
-
uniform
Returns the value of theuniformrecord component.- Returns:
- the value of the
uniformrecord component
-
values
public float[] values()Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-