mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 13:01:03 +00:00
Use getOpenStateMap()
in PlayerOpenStateManager
This commit is contained in:
parent
f87088f4f4
commit
7189e3701d
@ -33,7 +33,7 @@ public class PlayerOpenStateManager extends BasePlayerDataManager {
|
||||
public static final Set<OpenState> DEV_OPEN_STATES = Stream.of(OpenState.values())
|
||||
.filter(s -> s != OpenState.OPEN_STATE_NONE && s.getUnlockLevel() <= 1)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
|
||||
public PlayerOpenStateManager(Player player) {
|
||||
super(player);
|
||||
}
|
||||
@ -44,11 +44,11 @@ public class PlayerOpenStateManager extends BasePlayerDataManager {
|
||||
}
|
||||
|
||||
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) {
|
||||
Integer previousValue = this.map.getOrDefault(openState.getValue(),0);
|
||||
Integer previousValue = getOpenStateMap().getOrDefault(openState.getValue(),0);
|
||||
if (value != previousValue) {
|
||||
this.map.put(openState.getValue(), value);
|
||||
player.getSession().send(new PacketOpenStateChangeNotify(openState.getValue(),value));
|
||||
|
Loading…
Reference in New Issue
Block a user