Class SpyglassMouseModifier

java.lang.Object
io.github.ennuil.libzoomer.api.modifiers.SpyglassMouseModifier
All Implemented Interfaces:
MouseModifier

public class SpyglassMouseModifier extends Object implements MouseModifier
An implementation of the spyglass' reduction of the mouse sensitivity as a mouse modifier
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes an instance of the spyglass mouse modifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    applyXModifier(double cursorDeltaX, double cursorSensitivity, double mouseUpdateTimeDelta, double targetDivisor, double transitionMultiplier)
    Modifies the cursor's X delta to the value returned on this method.
    double
    applyYModifier(double cursorDeltaY, double cursorSensitivity, double mouseUpdateTimeDelta, double targetDivisor, double transitionMultiplier)
    Modifies the cursor's Y delta to the value returned on this method.
    boolean
    Gets the active state of the mouse modifier.
    net.minecraft.resources.ResourceLocation
    Gets the identifier of the mouse modifier.
    void
    tick(boolean active)
    The tick method.

    Methods inherited from class java.lang.Object

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

    • SpyglassMouseModifier

      public SpyglassMouseModifier()
      Initializes an instance of the spyglass mouse modifier.
  • Method Details

    • getId

      public net.minecraft.resources.ResourceLocation getId()
      Description copied from interface: MouseModifier
      Gets the identifier of the mouse modifier.
      Specified by:
      getId in interface MouseModifier
      Returns:
      the mouse modifier's identifier
    • getActive

      public boolean getActive()
      Description copied from interface: MouseModifier
      Gets the active state of the mouse modifier.
      Specified by:
      getActive in interface MouseModifier
      Returns:
      the mouse modifier's active state
    • applyXModifier

      public double applyXModifier(double cursorDeltaX, double cursorSensitivity, double mouseUpdateTimeDelta, double targetDivisor, double transitionMultiplier)
      Description copied from interface: MouseModifier
      Modifies the cursor's X delta to the value returned on this method.
      Specified by:
      applyXModifier in interface MouseModifier
      Parameters:
      cursorDeltaX - the X delta after the calculations
      cursorSensitivity - the cursor sensitivity that is applied to the cursor delta
      mouseUpdateTimeDelta - the delta of the mouse update time
      targetDivisor - the current zoom divisor
      transitionMultiplier - the transition mode's internal multiplier
      Returns:
      the X delta that will replace the cursor's one
    • applyYModifier

      public double applyYModifier(double cursorDeltaY, double cursorSensitivity, double mouseUpdateTimeDelta, double targetDivisor, double transitionMultiplier)
      Description copied from interface: MouseModifier
      Modifies the cursor's Y delta to the value returned on this method.
      Specified by:
      applyYModifier in interface MouseModifier
      Parameters:
      cursorDeltaY - the Y delta after the calculations
      cursorSensitivity - the cursor sensitivity that is applied to the cursor delta
      mouseUpdateTimeDelta - the delta of the mouse update time
      targetDivisor - the current zoom divisor
      transitionMultiplier - the transition mode's internal multiplier
      Returns:
      the Y delta that will replace the cursor's Y delta
    • tick

      public void tick(boolean active)
      Description copied from interface: MouseModifier
      The tick method. Used in order to keep the internal variables accurate.
      Specified by:
      tick in interface MouseModifier
      Parameters:
      active - the zoom state