mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-14 16:04:40 +01:00
Stamina will be set to full if Stamina is disabled.
This commit is contained in:
@@ -190,7 +190,9 @@ public class StaminaManager {
|
||||
|
||||
// Returns new stamina and sends PlayerPropNotify
|
||||
public int setStamina(GameSession session, String reason, int newStamina) {
|
||||
if (Grasscutter.getConfig().OpenStamina) {
|
||||
if (!Grasscutter.getConfig().OpenStamina) {
|
||||
newStamina = player.getProperty(PlayerProperty.PROP_MAX_STAMINA);
|
||||
}
|
||||
// set stamina
|
||||
player.setProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA, newStamina);
|
||||
session.send(new PacketPlayerPropNotify(player, PlayerProperty.PROP_CUR_PERSIST_STAMINA));
|
||||
@@ -200,8 +202,6 @@ public class StaminaManager {
|
||||
}
|
||||
return newStamina;
|
||||
}
|
||||
return player.getProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA);
|
||||
}
|
||||
|
||||
// Kills avatar, removes entity and sends notification.
|
||||
// TODO: Probably move this to Avatar class? since other components may also need to kill avatar.
|
||||
|
||||
Reference in New Issue
Block a user