Record Class EffectContext

java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.effect.EffectContext
Record Components:
effect - the effect being updated
player - the local player, if in a world
level - the client level, if in a world
partialTick - the partial tick of the frame
time - seconds of real time since the game started, wrapping every hour
deltaTime - seconds of real time since the previous frame
age - seconds since the effect last became visible, 0 while hidden
strength - the effect's strength from fading and ScreenEffect.setStrength(float), before its strength function
width - the framebuffer's width in pixels
height - 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 Classes
    Modifier and Type
    Class
    Description
    static interface 
    A function of the frame deciding how strong an effect is, from 0 to 1.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 a EffectContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    age()
    Returns the value of the age record component.
    float
    Returns the value of the deltaTime record component.
    Returns the value of the effect record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the height record component.
    boolean
     
    @Nullable net.minecraft.client.multiplayer.ClientLevel
    Returns the value of the level record component.
    net.minecraft.client.Minecraft
     
    float
    Returns the value of the partialTick record component.
    @Nullable net.minecraft.client.player.LocalPlayer
    Returns the value of the player record component.
    float
    Returns the value of the strength record component.
    float
    Returns the value of the time record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the width record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a EffectContext record class.
      Parameters:
      effect - the value for the effect record component
      player - the value for the player record component
      level - the value for the level record component
      partialTick - the value for the partialTick record component
      time - the value for the time record component
      deltaTime - the value for the deltaTime record component
      age - the value for the age record component
      strength - the value for the strength record component
      width - the value for the width record component
      height - the value for the height record component
  • Method Details

    • minecraft

      public net.minecraft.client.Minecraft minecraft()
    • inWorld

      public boolean inWorld()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • effect

      public ScreenEffect effect()
      Returns the value of the effect record component.
      Returns:
      the value of the effect record component
    • player

      public @Nullable net.minecraft.client.player.LocalPlayer player()
      Returns the value of the player record component.
      Returns:
      the value of the player record component
    • level

      public @Nullable net.minecraft.client.multiplayer.ClientLevel level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component
    • partialTick

      public float partialTick()
      Returns the value of the partialTick record component.
      Returns:
      the value of the partialTick record component
    • time

      public float time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • deltaTime

      public float deltaTime()
      Returns the value of the deltaTime record component.
      Returns:
      the value of the deltaTime record component
    • age

      public float age()
      Returns the value of the age record component.
      Returns:
      the value of the age record component
    • strength

      public float strength()
      Returns the value of the strength record component.
      Returns:
      the value of the strength record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component