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
7189e370
Commit
7189e370
authored
Jul 21, 2022
by
Melledy
Browse files
Use `getOpenStateMap()` in PlayerOpenStateManager
parent
f87088f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/player/PlayerOpenStateManager.java
View file @
7189e370
...
@@ -33,7 +33,7 @@ public class PlayerOpenStateManager extends BasePlayerDataManager {
...
@@ -33,7 +33,7 @@ public class PlayerOpenStateManager extends BasePlayerDataManager {
public
static
final
Set
<
OpenState
>
DEV_OPEN_STATES
=
Stream
.
of
(
OpenState
.
values
())
public
static
final
Set
<
OpenState
>
DEV_OPEN_STATES
=
Stream
.
of
(
OpenState
.
values
())
.
filter
(
s
->
s
!=
OpenState
.
OPEN_STATE_NONE
&&
s
.
getUnlockLevel
()
<=
1
)
.
filter
(
s
->
s
!=
OpenState
.
OPEN_STATE_NONE
&&
s
.
getUnlockLevel
()
<=
1
)
.
collect
(
Collectors
.
toSet
());
.
collect
(
Collectors
.
toSet
());
public
PlayerOpenStateManager
(
Player
player
)
{
public
PlayerOpenStateManager
(
Player
player
)
{
super
(
player
);
super
(
player
);
}
}
...
@@ -44,11 +44,11 @@ public class PlayerOpenStateManager extends BasePlayerDataManager {
...
@@ -44,11 +44,11 @@ public class PlayerOpenStateManager extends BasePlayerDataManager {
}
}
public
int
getOpenState
(
OpenState
openState
)
{
public
int
getOpenState
(
OpenState
openState
)
{
return
this
.
map
.
getOrDefault
(
openState
.
getValue
(),
0
);
return
getOpenStateMap
()
.
getOrDefault
(
openState
.
getValue
(),
0
);
}
}
public
void
setOpenState
(
OpenState
openState
,
Integer
value
)
{
public
void
setOpenState
(
OpenState
openState
,
Integer
value
)
{
Integer
previousValue
=
this
.
map
.
getOrDefault
(
openState
.
getValue
(),
0
);
Integer
previousValue
=
getOpenStateMap
()
.
getOrDefault
(
openState
.
getValue
(),
0
);
if
(
value
!=
previousValue
)
{
if
(
value
!=
previousValue
)
{
this
.
map
.
put
(
openState
.
getValue
(),
value
);
this
.
map
.
put
(
openState
.
getValue
(),
value
);
player
.
getSession
().
send
(
new
PacketOpenStateChangeNotify
(
openState
.
getValue
(),
value
));
player
.
getSession
().
send
(
new
PacketOpenStateChangeNotify
(
openState
.
getValue
(),
value
));
...
...
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