mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-10 18:12:53 +08:00
Move "if Grasscutter.getConfig().OpenStamina" to the correct place.
This commit is contained in:
parent
eb2b23928b
commit
5d917f185f
@ -190,6 +190,7 @@ public class StaminaManager {
|
||||
|
||||
// Returns new stamina and sends PlayerPropNotify
|
||||
public int setStamina(GameSession session, String reason, int newStamina) {
|
||||
if (Grasscutter.getConfig().OpenStamina) {
|
||||
// set stamina
|
||||
player.setProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA, newStamina);
|
||||
session.send(new PacketPlayerPropNotify(player, PlayerProperty.PROP_CUR_PERSIST_STAMINA));
|
||||
@ -199,6 +200,8 @@ 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.
|
||||
@ -288,7 +291,6 @@ public class StaminaManager {
|
||||
|
||||
private class SustainedStaminaHandler extends TimerTask {
|
||||
public void run() {
|
||||
if (Grasscutter.getConfig().OpenStamina) {
|
||||
boolean moving = isPlayerMoving();
|
||||
int currentStamina = player.getProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA);
|
||||
int maxStamina = player.getProperty(PlayerProperty.PROP_MAX_STAMINA);
|
||||
@ -333,7 +335,6 @@ public class StaminaManager {
|
||||
updateStaminaRelative(cachedSession, consumption);
|
||||
}
|
||||
}
|
||||
}
|
||||
previousState = currentState;
|
||||
previousCoordinates = new Position(
|
||||
currentCoordinates.getX(),
|
||||
|
Loading…
Reference in New Issue
Block a user