Class MinecraftWorld

java.lang.Object
lol.trq.helios.minecraft.MinecraftWorld

public final class MinecraftWorld extends Object
World-space helpers for overlays such as ESP boxes and nametags: the render partial tick, the camera position, and entity positions and boxes interpolated between ticks, relative to the camera (the space Minecraft's world matrices use). Reached by reflection with SRG names, MCP names as fallback.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Resolves everything up front.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    box(Object entity, float partialTicks, double[] camera, double[] out)
    Returns an entity's hitbox interpolated to this frame, relative to the camera.
    double[]
    camera(double[] out)
    Returns the camera position in world coordinates.
    float
    Returns how far the current frame is between the last tick and the next.
    double[]
    position(Object entity, float partialTicks, double[] camera, double[] out)
    Returns an entity's position interpolated to this frame, relative to the camera.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MinecraftWorld

      public MinecraftWorld(ClassLoader loader)
      Resolves everything up front.
      Parameters:
      loader - the class loader Minecraft's classes load through
      Throws:
      IllegalStateException - if a class or member cannot be found
  • Method Details

    • partialTicks

      public float partialTicks()
      Returns how far the current frame is between the last tick and the next.
      Returns:
      the partial tick, [0, 1)
    • camera

      public double[] camera(double[] out)
      Returns the camera position in world coordinates.
      Parameters:
      out - receives x, y, z
      Returns:
      out
    • position

      public double[] position(Object entity, float partialTicks, double[] camera, double[] out)
      Returns an entity's position interpolated to this frame, relative to the camera.
      Parameters:
      entity - a net.minecraft.entity.Entity
      partialTicks - the partial tick, from partialTicks()
      camera - the camera position, from camera(double[])
      out - receives x, y (feet), z
      Returns:
      out
    • box

      public double[] box(Object entity, float partialTicks, double[] camera, double[] out)
      Returns an entity's hitbox interpolated to this frame, relative to the camera.
      Parameters:
      entity - a net.minecraft.entity.Entity
      partialTicks - the partial tick
      camera - the camera position
      out - receives minX, minY, minZ, maxX, maxY, maxZ
      Returns:
      out