Class MoonHandler

java.lang.Object
com.mrbysco.lunar.client.MoonHandler

public class MoonHandler extends Object
Handles the moon color, texture and scale.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    colorTheMoon(net.minecraft.client.multiplayer.ClientLevel level, org.joml.Matrix4f frustumMatrix, org.joml.Matrix4f projectionMatrix, float partialTick, net.minecraft.client.Camera camera)
    Called to set the color of the moon.
    static void
    Clear the moon values.
    static int
    Get the color of the moon.
    static org.joml.Matrix4f
    Get the scale of the moon.
    static net.minecraft.resources.ResourceLocation
    getMoonTexture(net.minecraft.resources.ResourceLocation defaultTexture)
    Get the ID of the moon.
    static float
    Get the color of the moon as a float array.
    static boolean
    Check if the event is active.
    static boolean
    Check if the moon is scaled.
    static org.joml.Matrix4f
    scaleMoon(org.joml.Matrix4f matrix)
    Scale the moon.
    static void
    setMoon(String eventID, int color, float scale)
    Called to set the local values of the moon.
    static void
    setMoonTexture(@Nullable net.minecraft.resources.ResourceLocation location)
    Called to set the texture used for the moon.

    Methods inherited from class java.lang.Object

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

    • MoonHandler

      public MoonHandler()
  • Method Details

    • colorTheMoon

      public static void colorTheMoon(net.minecraft.client.multiplayer.ClientLevel level, org.joml.Matrix4f frustumMatrix, org.joml.Matrix4f projectionMatrix, float partialTick, net.minecraft.client.Camera camera)
      Called to set the color of the moon.
      Parameters:
      level - The level
      frustumMatrix - the frustum matrix
      projectionMatrix - the projection matrix
      partialTick - the partial tick
      camera - the camera
    • setMoon

      public static void setMoon(String eventID, int color, float scale)
      Called to set the local values of the moon.
      Parameters:
      eventID - The event ID
      color - The color of the moon
      scale - The scale of the moon
    • setMoonTexture

      public static void setMoonTexture(@Nullable @Nullable net.minecraft.resources.ResourceLocation location)
      Called to set the texture used for the moon.
      Parameters:
      location - The resource location of the texture
    • disableMoon

      public static void disableMoon()
      Clear the moon values.
    • isEventActive

      public static boolean isEventActive()
      Check if the event is active.
      Returns:
      true if the event is active, false otherwise
    • isMoonScaled

      public static boolean isMoonScaled()
      Check if the moon is scaled.
      Returns:
      true if the moon is scaled, false otherwise
    • getMoonTexture

      public static net.minecraft.resources.ResourceLocation getMoonTexture(net.minecraft.resources.ResourceLocation defaultTexture)
      Get the ID of the moon.
      Parameters:
      defaultTexture - The default texture
      Returns:
      the resource location of the moon texture
    • getMoonScale

      public static org.joml.Matrix4f getMoonScale()
      Get the scale of the moon.
      Returns:
      the scale of the moon
    • scaleMoon

      public static org.joml.Matrix4f scaleMoon(org.joml.Matrix4f matrix)
      Scale the moon.
      Parameters:
      matrix - the matrix to scale
      Returns:
      the scaled matrix
    • getMoonColor

      public static int getMoonColor()
      Get the color of the moon.
      Returns:
      the color int of the moon
    • getRawMoonScale

      public static float getRawMoonScale()
      Get the color of the moon as a float array.
      Returns:
      the color of the moon as a float array