Record Class RenderContext
java.lang.Object
java.lang.Record
com.soulfiremc.server.renderer.RenderContext
- Record Components:
level- The client level to rendercamera- Pre-computed camera with position and direction vectorssceneData- Pre-collected scene data (entities and map frames)maxDistance- Maximum render distance in blocksminY- World minimum Y coordinatemaxY- World maximum Y coordinateinvMaxDistance- 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
ConstructorsConstructorDescriptionRenderContext(net.minecraft.client.multiplayer.ClientLevel level, Camera camera, SceneData sceneData, int maxDistance, int minY, int maxY, double invMaxDistance) Creates an instance of aRenderContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncamera()Returns the value of thecamerarecord component.static RenderContextcreate(net.minecraft.client.multiplayer.ClientLevel level, Camera camera, SceneData sceneData, int maxDistance) Creates a render context with computed inverse max distance.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theinvMaxDistancerecord component.net.minecraft.client.multiplayer.ClientLevellevel()Returns the value of thelevelrecord component.intReturns the value of themaxDistancerecord component.intmaxY()Returns the value of themaxYrecord component.intminY()Returns the value of theminYrecord component.Returns the value of thesceneDatarecord component.final StringtoString()Returns a string representation of this record class.
-
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 aRenderContextrecord class.- Parameters:
level- the value for thelevelrecord componentcamera- the value for thecamerarecord componentsceneData- the value for thesceneDatarecord componentmaxDistance- the value for themaxDistancerecord componentminY- the value for theminYrecord componentmaxY- the value for themaxYrecord componentinvMaxDistance- the value for theinvMaxDistancerecord 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
-
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. -
level
-
camera
-
sceneData
-
maxDistance
public int maxDistance()Returns the value of themaxDistancerecord component.- Returns:
- the value of the
maxDistancerecord component
-
minY
-
maxY
-
invMaxDistance
public double invMaxDistance()Returns the value of theinvMaxDistancerecord component.- Returns:
- the value of the
invMaxDistancerecord component
-