Interface MouseModifier

All Known Implementing Classes:
CinematicCameraMouseModifier, ContainingMouseModifier, SpyglassMouseModifier, ZoomDivisorMouseModifier

public interface MouseModifier
The mouse modifier is the sub-instance that handles any change of behavior of the mouse.
  • 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.util.Identifier
    Gets the identifier of the mouse modifier.
    void
    tick(boolean active)
    The tick method.
  • Method Details

    • getIdentifier

      net.minecraft.util.Identifier getIdentifier()
      Gets the identifier of the mouse modifier.
      Returns:
      the mouse modifier's identifier
    • getActive

      boolean getActive()
      Gets the active state of the mouse modifier.
      Returns:
      the mouse modifier's active state
    • applyXModifier

      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.
      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

      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.
      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

      void tick(boolean active)
      The tick method. Used in order to keep the internal variables accurate.
      Parameters:
      active - the zoom state