Class MovementManager

java.lang.Object
me.hackware.api.MovementManager

public final class MovementManager extends Object
Centralized movement manager — velocity injections, jumps, gravity toggles.

All module-originated velocity mutations and jump triggers go through this manager so they are auditable via the Debug tab's Manager feed.

  • Method Details

    • get

      public static MovementManager get()
    • init

      public void init()
      Register event handlers. Call once during mod init.
    • setVelocity

      public void setVelocity(String caller, double x, double y, double z)
      Overrides the player's velocity entirely.
      Parameters:
      caller - descriptive source (module name or manager)
      x - x velocity
      y - y velocity
      z - z velocity
    • setVelocity

      public void setVelocity(String caller, net.minecraft.world.phys.Vec3 velocity)
      Overrides the player's velocity entirely.
    • addVelocity

      public void addVelocity(String caller, double x, double y, double z)
      Adds to the player's current velocity (push/impulse).
      Parameters:
      caller - descriptive source
      x - x delta
      y - y delta
      z - z delta
    • scaleVelocity

      public void scaleVelocity(String caller, double xScale, double yScale, double zScale)
      Scales the player's velocity by the given factors.
      Parameters:
      caller - descriptive source
      xScale - x multiplier
      yScale - y multiplier
      zScale - z multiplier
    • setHorizontalVelocity

      public void setHorizontalVelocity(String caller, double x, double z)
      Sets only the horizontal velocity, preserving the current Y component.
    • setVerticalVelocity

      public void setVerticalVelocity(String caller, double y)
      Sets only the vertical velocity, preserving horizontal components.
    • jump

      public void jump(String caller)
      Forces the player to jump from ground (vanilla jump).
    • jumpIfGrounded

      public boolean jumpIfGrounded(String caller)
      Jumps only if the player is on the ground.
      Returns:
      true if the jump was executed
    • setNoGravity

      public void setNoGravity(String caller, boolean noGravity)
      Sets the player's noGravity state.