Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
0ea0eab6
Commit
0ea0eab6
authored
May 10, 2022
by
gentlespoon
Committed by
Melledy
May 10, 2022
Browse files
Stamina will be set to full if Stamina is disabled.
parent
c424d15b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/managers/StaminaManager/StaminaManager.java
View file @
0ea0eab6
...
...
@@ -190,17 +190,17 @@ 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
));
// notify updated
for
(
Map
.
Entry
<
String
,
AfterUpdateStaminaListener
>
listener
:
afterUpdateStaminaListeners
.
entrySet
())
{
listener
.
getValue
().
onAfterUpdateStamina
(
reason
,
newStamina
);
}
return
newStamina
;
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
));
// notify updated
for
(
Map
.
Entry
<
String
,
AfterUpdateStaminaListener
>
listener
:
afterUpdateStaminaListeners
.
entrySet
())
{
listener
.
getValue
().
onAfterUpdateStamina
(
reason
,
newStamina
)
;
}
return
player
.
getProperty
(
PlayerProperty
.
PROP_CUR_PERSIST_STAMINA
)
;
return
newStamina
;
}
// Kills avatar, removes entity and sends notification.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment