Record Class RenderContext

java.lang.Object
java.lang.Record
com.soulfiremc.server.renderer.RenderContext
Record Components:
level - The client level to render
camera - Pre-computed camera with position and direction vectors
sceneData - Pre-collected scene data (entities and map frames)
maxDistance - Maximum render distance in blocks
minY - World minimum Y coordinate
maxY - World maximum Y coordinate
invMaxDistance - Pre-computed 1.0 / maxDistance for fog calculations

public record RenderContext(net.minecraft.client.multiplayer.ClientLevel level, Camera camera, SceneData sceneData, int maxDistance, int minY, int maxY, double invMaxDistance) extends Record
Pre-computed render context containing all data needed for ray casting. Groups related parameters together to avoid passing many individual arguments.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RenderContext(net.minecraft.client.multiplayer.ClientLevel level, Camera camera, SceneData sceneData, int maxDistance, int minY, int maxY, double invMaxDistance)
    Creates an instance of a RenderContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the camera record component.
    create(net.minecraft.client.multiplayer.ClientLevel level, Camera camera, SceneData sceneData, int maxDistance)
    Creates a render context with computed inverse max distance.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the invMaxDistance record component.
    net.minecraft.client.multiplayer.ClientLevel
    Returns the value of the level record component.
    int
    Returns the value of the maxDistance record component.
    int
    Returns the value of the maxY record component.
    int
    Returns the value of the minY record component.
    Returns the value of the sceneData record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RenderContext

      public RenderContext(net.minecraft.client.multiplayer.ClientLevel level, Camera camera, SceneData sceneData, int maxDistance, int minY, int maxY, double invMaxDistance)
      Creates an instance of a RenderContext record class.
      Parameters:
      level - the value for the level record component
      camera - the value for the camera record component
      sceneData - the value for the sceneData record component
      maxDistance - the value for the maxDistance record component
      minY - the value for the minY record component
      maxY - the value for the maxY record component
      invMaxDistance - the value for the invMaxDistance record component
  • Method Details

    • create

      public static RenderContext create(net.minecraft.client.multiplayer.ClientLevel level, Camera camera, SceneData sceneData, int maxDistance)
      Creates a render context with computed inverse max distance.
    • 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.
    • level

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

      public Camera camera()
      Returns the value of the camera record component.
      Returns:
      the value of the camera record component
    • sceneData

      public SceneData sceneData()
      Returns the value of the sceneData record component.
      Returns:
      the value of the sceneData record component
    • maxDistance

      public int maxDistance()
      Returns the value of the maxDistance record component.
      Returns:
      the value of the maxDistance record component
    • minY

      public int minY()
      Returns the value of the minY record component.
      Returns:
      the value of the minY record component
    • maxY

      public int maxY()
      Returns the value of the maxY record component.
      Returns:
      the value of the maxY record component
    • invMaxDistance

      public double invMaxDistance()
      Returns the value of the invMaxDistance record component.
      Returns:
      the value of the invMaxDistance record component