Contents
Class HotbarManager
java.lang.Object
com.hypixel.hytale.server.core.entity.entities.player.HotbarManager
A class that handles all hotbar-related functionality for a player
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<HotbarManager> The codec used to parseHotbarManagerinstancesstatic final intThe maximum number of hotbars to store -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanvoidloadHotbar(Ref<EntityStore> playerRef, short hotbarIndex, ComponentAccessor<EntityStore> componentAccessor) Called to load the hotbar of the given indexvoidsaveHotbar(Ref<EntityStore> playerRef, short hotbarIndex, ComponentAccessor<EntityStore> componentAccessor) Called to save the hotbar of the given index
-
Field Details
-
HOTBARS_MAX
public static final int HOTBARS_MAXThe maximum number of hotbars to store- See Also:
-
CODEC
The codec used to parseHotbarManagerinstances
-
-
Constructor Details
-
HotbarManager
public HotbarManager()
-
-
Method Details
-
saveHotbar
public void saveHotbar(@Nonnull Ref<EntityStore> playerRef, short hotbarIndex, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to save the hotbar of the given index- Parameters:
playerRef- The entity reference of the player entityhotbarIndex- The index of the hotbarcomponentAccessor- TheComponentAccessorfor component access
-
loadHotbar
public void loadHotbar(@Nonnull Ref<EntityStore> playerRef, short hotbarIndex, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to load the hotbar of the given index- Parameters:
playerRef- The entity reference of the player entityhotbarIndex- The index of the hotbarcomponentAccessor- TheComponentAccessorfor component access
-
getCurrentHotbarIndex
public int getCurrentHotbarIndex()- Returns:
- the current hotbar index that is active
-
getIsCurrentlyLoadingHotbar
public boolean getIsCurrentlyLoadingHotbar()- Returns:
trueif a hotbar is being loaded,falseotherwise
-