mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-18 01:46:44 +01:00
Fix whitespace [skip actions]
This commit is contained in:
@@ -19,7 +19,7 @@ import static emu.grasscutter.game.props.OpenState.*;
|
||||
public class PlayerOpenStateManager extends BasePlayerDataManager {
|
||||
// Map of all open states that this player has. Do not put default values here.
|
||||
private Map<Integer, Integer> map;
|
||||
|
||||
|
||||
/*
|
||||
//DO NOT MODIFY. Based on conversation of official server and client, game version 2.7
|
||||
private static Set<OpenState> newPlayerOpenStates = Set.of(OPEN_STATE_DERIVATIVE_MALL,OPEN_STATE_PHOTOGRAPH,OPEN_STATE_BATTLE_PASS,OPEN_STATE_SHOP_TYPE_GENESISCRYSTAL,OPEN_STATE_SHOP_TYPE_RECOMMANDED,
|
||||
@@ -27,7 +27,7 @@ public class PlayerOpenStateManager extends BasePlayerDataManager {
|
||||
OPEN_STATE_WEAPON_PROMOTE,OPEN_STATE_AVATAR_PROMOTE,OPEN_STATE_AVATAR_TALENT,OPEN_STATE_WEAPON_UPGRADE,OPEN_STATE_RESIN,OPEN_STATE_RELIQUARY_UPGRADE,
|
||||
OPEN_STATE_SHOP_TYPE_VIRTUAL_SHOP,OPEN_STATE_RELIQUARY_PROMOTE);
|
||||
*/
|
||||
|
||||
|
||||
// For development. Remove entry when properly implemented
|
||||
// TODO - Set as boolean in OpenState
|
||||
public static final Set<OpenState> DEV_OPEN_STATES = Stream.of(OpenState.values())
|
||||
@@ -38,25 +38,25 @@ public class PlayerOpenStateManager extends BasePlayerDataManager {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getOpenStateMap() {
|
||||
if (this.map == null) this.map = new HashMap<>();
|
||||
return this.map;
|
||||
}
|
||||
public Map<Integer, Integer> getOpenStateMap() {
|
||||
if (this.map == null) this.map = new HashMap<>();
|
||||
return this.map;
|
||||
}
|
||||
|
||||
public int getOpenState(OpenState openState) {
|
||||
return this.map.getOrDefault(openState.getValue(), 0);
|
||||
}
|
||||
|
||||
|
||||
public void setOpenState(OpenState openState, Integer value) {
|
||||
Integer previousValue = this.map.getOrDefault(openState.getValue(),0);
|
||||
if(value != previousValue) {
|
||||
if (value != previousValue) {
|
||||
this.map.put(openState.getValue(), value);
|
||||
player.getSession().send(new PacketOpenStateChangeNotify(openState.getValue(),value));
|
||||
}
|
||||
}
|
||||
|
||||
public void setOpenStates(Map<OpenState,Integer> openStatesChanged) {
|
||||
for(Map.Entry<OpenState, Integer> entry : openStatesChanged.entrySet()) {
|
||||
for (Map.Entry<OpenState, Integer> entry : openStatesChanged.entrySet()) {
|
||||
setOpenState(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
@@ -70,4 +70,4 @@ public class PlayerOpenStateManager extends BasePlayerDataManager {
|
||||
.filter(s -> s.getUnlockLevel() > 1 && s.getUnlockLevel() <= this.player.getLevel())
|
||||
.forEach(s -> this.setOpenState(s, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user