mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 03:12:52 +08:00
Fix whitespace [skip actions]
This commit is contained in:
parent
d1d39db56c
commit
025e5d3c1c
@ -39,11 +39,11 @@ public class GameHome {
|
||||
ConcurrentHashMap<Integer, HomeSceneItem> sceneMap;
|
||||
Set<Integer> unlockedHomeBgmList;
|
||||
|
||||
public void save(){
|
||||
public void save() {
|
||||
DatabaseHelper.saveHome(this);
|
||||
}
|
||||
|
||||
public static GameHome getByUid(Integer uid){
|
||||
public static GameHome getByUid(Integer uid) {
|
||||
var home = DatabaseHelper.getHomeByUid(uid);
|
||||
if (home == null) {
|
||||
home = GameHome.create(uid);
|
||||
@ -51,7 +51,7 @@ public class GameHome {
|
||||
return home;
|
||||
}
|
||||
|
||||
public static GameHome create(Integer uid){
|
||||
public static GameHome create(Integer uid) {
|
||||
return GameHome.of()
|
||||
.ownerUid(uid)
|
||||
.level(1)
|
||||
@ -62,7 +62,7 @@ public class GameHome {
|
||||
public HomeSceneItem getHomeSceneItem(int sceneId) {
|
||||
return sceneMap.computeIfAbsent(sceneId, e -> {
|
||||
var defaultItem = GameData.getHomeworldDefaultSaveData().get(sceneId);
|
||||
if (defaultItem != null){
|
||||
if (defaultItem != null) {
|
||||
Grasscutter.getLogger().info("Set player {} home {} to initial setting", ownerUid, sceneId);
|
||||
return HomeSceneItem.parseFrom(defaultItem, sceneId);
|
||||
}
|
||||
@ -87,7 +87,7 @@ public class GameHome {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public HomeWorldLevelData getLevelData(){
|
||||
public HomeWorldLevelData getLevelData() {
|
||||
return GameData.getHomeWorldLevelDataMap().get(level);
|
||||
}
|
||||
|
||||
|
@ -42,10 +42,10 @@ public class HomeSceneItem {
|
||||
.build();
|
||||
}
|
||||
|
||||
public void update(HomeSceneArrangementInfo arrangementInfo){
|
||||
for(var blockItem : arrangementInfo.getBlockArrangementInfoListList()){
|
||||
public void update(HomeSceneArrangementInfo arrangementInfo) {
|
||||
for (var blockItem : arrangementInfo.getBlockArrangementInfoListList()) {
|
||||
var block = this.blockItems.get(blockItem.getBlockId());
|
||||
if(block == null){
|
||||
if (block == null) {
|
||||
Grasscutter.getLogger().warn("Could not found the Home Block {}", blockItem.getBlockId());
|
||||
continue;
|
||||
}
|
||||
@ -61,20 +61,20 @@ public class HomeSceneItem {
|
||||
this.tmpVersion = arrangementInfo.getTmpVersion();
|
||||
}
|
||||
|
||||
public int getRoomSceneId(){
|
||||
if(mainHouse == null || mainHouse.getAsItem() == null){
|
||||
public int getRoomSceneId() {
|
||||
if (mainHouse == null || mainHouse.getAsItem() == null) {
|
||||
return 0;
|
||||
}
|
||||
return mainHouse.getAsItem().getRoomSceneId();
|
||||
}
|
||||
|
||||
public int calComfort(){
|
||||
public int calComfort() {
|
||||
return this.blockItems.values().stream()
|
||||
.mapToInt(HomeBlockItem::calComfort)
|
||||
.sum();
|
||||
}
|
||||
|
||||
public HomeSceneArrangementInfo toProto(){
|
||||
public HomeSceneArrangementInfo toProto() {
|
||||
var proto = HomeSceneArrangementInfo.newBuilder();
|
||||
blockItems.values().forEach(b -> proto.addBlockArrangementInfoList(b.toProto()));
|
||||
|
||||
@ -87,7 +87,7 @@ public class HomeSceneItem {
|
||||
.setUnk2700BJHAMKKECEI(homeBgmId)
|
||||
.setTmpVersion(tmpVersion);
|
||||
|
||||
if(mainHouse != null){
|
||||
if (mainHouse != null) {
|
||||
proto.setMainHouse(mainHouse.toProto());
|
||||
}
|
||||
return proto.build();
|
||||
|
@ -27,7 +27,7 @@ public class PlayerCodex {
|
||||
@Getter private Set<Integer> unlockedReliquary;
|
||||
@Getter private Set<Integer> unlockedReliquarySuitCodex;
|
||||
|
||||
public PlayerCodex(){
|
||||
public PlayerCodex() {
|
||||
this.unlockedWeapon = new HashSet<>();
|
||||
this.unlockedAnimal = new HashMap<>();
|
||||
this.unlockedMaterial = new HashSet<>();
|
||||
@ -38,7 +38,7 @@ public class PlayerCodex {
|
||||
this.unlockedReliquarySuitCodex = new HashSet<>();
|
||||
}
|
||||
|
||||
public PlayerCodex(Player player){
|
||||
public PlayerCodex(Player player) {
|
||||
this();
|
||||
this.player = player;
|
||||
}
|
||||
@ -48,7 +48,7 @@ public class PlayerCodex {
|
||||
this.fixReliquaries();
|
||||
}
|
||||
|
||||
public void checkAddedItem(GameItem item){
|
||||
public void checkAddedItem(GameItem item) {
|
||||
val itemData = item.getItemData();
|
||||
val itemId = item.getItemId();
|
||||
switch (itemData.getItemType()) {
|
||||
@ -85,7 +85,7 @@ public class PlayerCodex {
|
||||
}
|
||||
}
|
||||
|
||||
public void checkAnimal(GameEntity target, CodexAnimalData.CountType countType){
|
||||
public void checkAnimal(GameEntity target, CodexAnimalData.CountType countType) {
|
||||
if (target instanceof EntityMonster) {
|
||||
val monsterId = ((EntityMonster) target).getMonsterData().getId();
|
||||
val codexAnimal = GameData.getCodexAnimalDataMap().get(monsterId);
|
||||
@ -101,7 +101,7 @@ public class PlayerCodex {
|
||||
}
|
||||
}
|
||||
|
||||
public void checkUnlockedSuits(int reliquaryId){
|
||||
public void checkUnlockedSuits(int reliquaryId) {
|
||||
GameData.getCodexReliquaryArrayList().stream()
|
||||
.filter(x -> !this.getUnlockedReliquarySuitCodex().contains(x.getId()))
|
||||
.filter(x -> x.containsId(reliquaryId))
|
||||
|
@ -27,7 +27,7 @@ public abstract class ItemUseAddEnergy extends ItemUseAction {
|
||||
var activeTeam = teamManager.getActiveTeam();
|
||||
// On-field vs off-field multiplier.
|
||||
// The on-field character gets full amount, off-field characters get less depending on the team size.
|
||||
final float offFieldRatio = switch(activeTeam.size()) {
|
||||
final float offFieldRatio = switch (activeTeam.size()) {
|
||||
case 2 -> 0.8f;
|
||||
case 3 -> 0.7f;
|
||||
default -> 0.6f;
|
||||
|
@ -85,7 +85,7 @@ public class WorldDataSystem extends BaseGameSystem {
|
||||
return level;
|
||||
}
|
||||
private InvestigationMonsterOuterClass.InvestigationMonster getInvestigationMonster(Player player, InvestigationMonsterData imd) {
|
||||
if(imd.getGroupIdList().isEmpty() || imd.getMonsterIdList().isEmpty()){
|
||||
if (imd.getGroupIdList().isEmpty() || imd.getMonsterIdList().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -84,10 +84,10 @@ public class ScriptLoader {
|
||||
ctx.globals.set("ScriptLib", scriptLibLua);
|
||||
}
|
||||
|
||||
public static <T> Optional<T> tryGet(SoftReference<T> softReference){
|
||||
try{
|
||||
public static <T> Optional<T> tryGet(SoftReference<T> softReference) {
|
||||
try {
|
||||
return Optional.ofNullable(softReference.get());
|
||||
}catch (NullPointerException npe){
|
||||
}catch (NullPointerException npe) {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user