From 9b3ca239c9f75c5a730d627db07dcb9066655d14 Mon Sep 17 00:00:00 2001 From: gentlespoon Date: Sat, 7 May 2022 00:23:56 -0700 Subject: [PATCH] Prepare MovementManager.updateStamina() for external calls. --- .../game/managers/MovementManager/MovementManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/managers/MovementManager/MovementManager.java b/src/main/java/emu/grasscutter/game/managers/MovementManager/MovementManager.java index 8b8485f26..60de57055 100644 --- a/src/main/java/emu/grasscutter/game/managers/MovementManager/MovementManager.java +++ b/src/main/java/emu/grasscutter/game/managers/MovementManager/MovementManager.java @@ -179,8 +179,6 @@ public class MovementManager { return player.getProperty(PlayerProperty.PROP_MAX_STAMINA); } - - // Returns new stamina public int updateStamina(GameSession session, int amount) { int currentStamina = session.getPlayer().getProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA); @@ -196,6 +194,7 @@ public class MovementManager { newStamina = playerMaxStamina; } session.getPlayer().setProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA, newStamina); + session.send(new PacketPlayerPropNotify(player, PlayerProperty.PROP_CUR_PERSIST_STAMINA)); return newStamina; } @@ -309,7 +308,6 @@ public class MovementManager { } Grasscutter.getLogger().debug(getCurrentStamina() + "/" + getMaximumStamina() + "\t" + currentState + "\t" + "isMoving: " + isPlayerMoving() + "\t(" + consumption.consumptionType + "," + consumption.amount + ")"); updateStamina(cachedSession, consumption.amount); - cachedSession.send(new PacketPlayerPropNotify(player, PlayerProperty.PROP_CUR_PERSIST_STAMINA)); } // tick triggered