Class MovementManager

java.lang.Object
com.hypixel.hytale.server.core.entity.entities.player.movement.MovementManager
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class MovementManager extends Object implements Component<EntityStore>
  • Field Details

  • Constructor Details

    • MovementManager

      public MovementManager()
    • MovementManager

      public MovementManager(@Nonnull MovementManager other)
  • Method Details

    • getComponentType

      public static ComponentType<EntityStore, MovementManager> getComponentType()
    • resetDefaultsAndUpdate

      public void resetDefaultsAndUpdate(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Reprocesses and reapplies the default values based on the player. Note: This method should be called after the component is initialized.
      Parameters:
      ref - The entity reference of the entity
      componentAccessor - The component store for component access
    • refreshDefaultSettings

      public void refreshDefaultSettings(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Reprocess the default values from the GameplayConfig based on the provided PhysicsValues and GameMode Note: Not to be confused with applyDefaultSettings()
      Parameters:
      ref - The entity reference of the entity
      componentAccessor - The component store of component access
    • applyDefaultSettings

      public void applyDefaultSettings()
      Apply the default settings as the current settings
    • applyConfigAndUpdate

      public void applyConfigAndUpdate(@Nonnull MovementConfig movementConfig, @Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Applies the given movement config as the current settings and sends them to the client, keeping the entity-derived physics values. Fly capability comes from the config's Fly, or stays unchanged when the config leaves it unset.
      Parameters:
      movementConfig - The movement config to apply.
      ref - The entity reference of the entity.
      componentAccessor - The component store for component access.
    • update

      public void update(@Nonnull PacketHandler playerPacketHandler)
      Send the settings to the client
      Parameters:
      playerPacketHandler - the client to send the settings to
    • getSettings

      public MovementSettings getSettings()
      Returns:
      Current settings for this player
    • setDefaultSettings

      public void setDefaultSettings(@Nonnull MovementConfig movementConfig, @Nonnull PhysicsValues physicsValues, GameMode gameMode)
    • resetFly

      public void resetFly(GameMode gameMode)
      Re-derives the fly capability for the given game mode on both the default and current settings, honoring the movement config's Fly override when set.
      Parameters:
      gameMode - The player's game mode.
    • getDefaultSettings

      public MovementSettings getDefaultSettings()
      Returns:
      Default settings for this player
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • clone

      @Nonnull public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.