Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getComponentType()
- resetDefaultsAndUpdate(Ref, ComponentAccessor)
- refreshDefaultSettings(Ref, ComponentAccessor)
- applyDefaultSettings()
- applyConfigAndUpdate(MovementConfig, Ref, ComponentAccessor)
- update(PacketHandler)
- getSettings()
- setDefaultSettings(MovementConfig, PhysicsValues, GameMode)
- resetFly(GameMode)
- getDefaultSettings()
- toString()
- clone()
Class MovementManager
java.lang.Object
com.hypixel.hytale.server.core.entity.entities.player.movement.MovementManager
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BiFunction<PhysicsValues, GameMode, MovementSettings> Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyConfigAndUpdate(MovementConfig movementConfig, Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Applies the given movement config as the current settings and sends them to the client, keeping the entity-derived physics values.voidApply the default settings as the current settingsclone()static ComponentType<EntityStore, MovementManager> voidrefreshDefaultSettings(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Reprocess the default values from the GameplayConfig based on the provided PhysicsValues and GameMode Note: Not to be confused withapplyDefaultSettings()voidresetDefaultsAndUpdate(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Reprocesses and reapplies the default values based on the player.voidRe-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.voidsetDefaultSettings(MovementConfig movementConfig, PhysicsValues physicsValues, GameMode gameMode) toString()voidupdate(PacketHandler playerPacketHandler) Send the settings to the clientMethods inherited from interface Component
cloneSerializable
-
Field Details
-
MASTER_DEFAULT
-
-
Constructor Details
-
MovementManager
public MovementManager() -
MovementManager
-
-
Method Details
-
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 entitycomponentAccessor- 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 withapplyDefaultSettings()- Parameters:
ref- The entity reference of the entitycomponentAccessor- 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
Send the settings to the client- Parameters:
playerPacketHandler- the client to send the settings to
-
getSettings
- Returns:
- Current settings for this player
-
setDefaultSettings
public void setDefaultSettings(@Nonnull MovementConfig movementConfig, @Nonnull PhysicsValues physicsValues, GameMode gameMode) -
resetFly
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
- Returns:
- Default settings for this player
-
toString
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-