Record Class EffectContext
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.effect.EffectContext
- Record Components:
effect- the effect being updatedplayer- the local player, if in a worldlevel- the client level, if in a worldpartialTick- the partial tick of the frametime- seconds of real time since the game started, wrapping every hourdeltaTime- seconds of real time since the previous frameage- seconds since the effect last became visible, 0 while hiddenstrength- the effect's strength from fading andScreenEffect.setStrength(float), before its strength functionwidth- the framebuffer's width in pixelsheight- the framebuffer's height in pixels
public record EffectContext(ScreenEffect effect, @Nullable net.minecraft.client.player.LocalPlayer player, @Nullable net.minecraft.client.multiplayer.ClientLevel level, float partialTick, float time, float deltaTime, float age, float strength, int width, int height)
extends Record
What a screen effect's callbacks see of the current frame.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA function of the frame deciding how strong an effect is, from 0 to 1. -
Constructor Summary
ConstructorsConstructorDescriptionEffectContext(ScreenEffect effect, @Nullable net.minecraft.client.player.LocalPlayer player, @Nullable net.minecraft.client.multiplayer.ClientLevel level, float partialTick, float time, float deltaTime, float age, float strength, int width, int height) Creates an instance of aEffectContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatage()Returns the value of theagerecord component.floatReturns the value of thedeltaTimerecord component.effect()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.intheight()Returns the value of theheightrecord component.booleaninWorld()@Nullable net.minecraft.client.multiplayer.ClientLevellevel()Returns the value of thelevelrecord component.net.minecraft.client.MinecraftfloatReturns the value of thepartialTickrecord component.@Nullable net.minecraft.client.player.LocalPlayerplayer()Returns the value of theplayerrecord component.floatstrength()Returns the value of thestrengthrecord component.floattime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
EffectContext
public EffectContext(ScreenEffect effect, @Nullable net.minecraft.client.player.LocalPlayer player, @Nullable net.minecraft.client.multiplayer.ClientLevel level, float partialTick, float time, float deltaTime, float age, float strength, int width, int height) Creates an instance of aEffectContextrecord class.- Parameters:
effect- the value for theeffectrecord componentplayer- the value for theplayerrecord componentlevel- the value for thelevelrecord componentpartialTick- the value for thepartialTickrecord componenttime- the value for thetimerecord componentdeltaTime- the value for thedeltaTimerecord componentage- the value for theagerecord componentstrength- the value for thestrengthrecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord component
-
-
Method Details
-
minecraft
public net.minecraft.client.Minecraft minecraft() -
inWorld
public boolean inWorld() -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
effect
-
player
-
level
-
partialTick
public float partialTick()Returns the value of thepartialTickrecord component.- Returns:
- the value of the
partialTickrecord component
-
time
-
deltaTime
-
age
-
strength
-
width
-
height
-