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 org.joml.Vector4f
    colorTheMoon(org.joml.Vector4f originalColor)
    Called to set the color of the moon.
    static void
    Clear the moon values.
    static com.mojang.renderpearl.api.buffers.GpuBuffer
    getMoonBuffer(com.mojang.renderpearl.api.buffers.GpuBuffer defaultBuffer)
    Get the ID of the moon.
    static int
    Get the color of the moon.
    static org.joml.Matrix4f
    Get the scale 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
    setMoonBuffer(@Nullable net.minecraft.resources.Identifier textureLocation)
    Called to set the texture used for the moon.

    Methods inherited from class Object

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

    • MoonHandler

      public MoonHandler()
  • Method Details

    • colorTheMoon

      public static org.joml.Vector4f colorTheMoon(org.joml.Vector4f originalColor)
      Called to set the color of the moon.
    • 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
    • setMoonBuffer

      public static void setMoonBuffer(@Nullable @Nullable net.minecraft.resources.Identifier textureLocation)
      Called to set the texture used for the moon.
      Parameters:
      textureLocation - The AbstractTexture 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
    • getMoonBuffer

      public static com.mojang.renderpearl.api.buffers.GpuBuffer getMoonBuffer(com.mojang.renderpearl.api.buffers.GpuBuffer defaultBuffer)
      Get the ID of the moon.
      Parameters:
      defaultBuffer - The default gpu buffer
      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