From 837e30e04b238151ae2b6ab02876d69901d4b985 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:19:46 +0000 Subject: [PATCH] Format code [skip actions] --- .../game/dungeons/DungeonManager.java | 7 ++++--- .../grasscutter/game/tower/TowerManager.java | 20 +++++++++++++------ .../send/PacketTowerLevelStarCondNotify.java | 16 ++++----------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/dungeons/DungeonManager.java b/src/main/java/emu/grasscutter/game/dungeons/DungeonManager.java index da8ba4dea..140dfe5ba 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/DungeonManager.java +++ b/src/main/java/emu/grasscutter/game/dungeons/DungeonManager.java @@ -324,9 +324,10 @@ public final class DungeonManager { p.getBattlePassManager().triggerMission(WatcherTriggerType.TRIGGER_FINISH_DUNGEON); } }); - var future = scene - .getScriptManager() - .callEvent(new ScriptArgs(0, EventType.EVENT_DUNGEON_SETTLE, successfully ? 1 : 0)); + var future = + scene + .getScriptManager() + .callEvent(new ScriptArgs(0, EventType.EVENT_DUNGEON_SETTLE, successfully ? 1 : 0)); // Note: There is a possible race condition with calling // EVENT_DUNGEON_SETTLE here asynchronously: // 1. EVENT_DUNGEON_SETTLE triggers some Lua-side logic, diff --git a/src/main/java/emu/grasscutter/game/tower/TowerManager.java b/src/main/java/emu/grasscutter/game/tower/TowerManager.java index 6863c7de3..c0e4b70c4 100644 --- a/src/main/java/emu/grasscutter/game/tower/TowerManager.java +++ b/src/main/java/emu/grasscutter/game/tower/TowerManager.java @@ -47,7 +47,9 @@ public class TowerManager extends BasePlayerManager { while (stars < currentPossibleStars) { player .getSession() - .send(new PacketTowerLevelStarCondNotify(getTowerData().currentFloorId, getCurrentLevel(), currentPossibleStars)); + .send( + new PacketTowerLevelStarCondNotify( + getTowerData().currentFloorId, getCurrentLevel(), currentPossibleStars)); currentPossibleStars--; } } @@ -117,7 +119,9 @@ public class TowerManager extends BasePlayerManager { currentPossibleStars = 3; player .getSession() - .send(new PacketTowerLevelStarCondNotify(getTowerData().currentFloorId, getCurrentLevel(), currentPossibleStars + 1)); + .send( + new PacketTowerLevelStarCondNotify( + getTowerData().currentFloorId, getCurrentLevel(), currentPossibleStars + 1)); } public void notifyCurLevelRecordChange() { @@ -143,7 +147,8 @@ public class TowerManager extends BasePlayerManager { var cond = levelData.getCondType(star); if (cond == TowerLevelData.TowerCondType.TOWER_COND_CHALLENGE_LEFT_TIME_MORE_THAN) { var params = levelData.getTimeCond(star); - var timeRemaining = challenge.getTimeLimit() - (scene.getSceneTimeSeconds() - challenge.getStartedAt()); + var timeRemaining = + challenge.getTimeLimit() - (scene.getSceneTimeSeconds() - challenge.getStartedAt()); if (timeRemaining >= params.getMinimumTimeInSeconds()) { break; } @@ -151,7 +156,11 @@ public class TowerManager extends BasePlayerManager { // TODO: Check monolith health break; } else { - Grasscutter.getLogger().error("getCurLevelStars: Tower level {} has no or unknown condition defined for {} stars", getCurrentLevelId(), star + 1); + Grasscutter.getLogger() + .error( + "getCurLevelStars: Tower level {} has no or unknown condition defined for {} stars", + getCurrentLevelId(), + star + 1); continue; } } @@ -174,8 +183,7 @@ public class TowerManager extends BasePlayerManager { prevStars = prevRecord.getLevelStars(getCurrentLevelId()); } if (stars > prevStars) { - recordMap.put( - currentFloorId, prevRecord.setLevelStars(getCurrentLevelId(), stars)); + recordMap.put(currentFloorId, prevRecord.setLevelStars(getCurrentLevelId(), stars)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketTowerLevelStarCondNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketTowerLevelStarCondNotify.java index c2c5b9036..3c5026744 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketTowerLevelStarCondNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketTowerLevelStarCondNotify.java @@ -9,9 +9,7 @@ public class PacketTowerLevelStarCondNotify extends BasePacket { public PacketTowerLevelStarCondNotify(int floorId, int levelIndex, int lostStar) { super(PacketOpcodes.TowerLevelStarCondNotify); - var proto = TowerLevelStarCondNotify.newBuilder() - .setFloorId(floorId) - .setLevelIndex(levelIndex); + var proto = TowerLevelStarCondNotify.newBuilder().setFloorId(floorId).setLevelIndex(levelIndex); if (1 <= lostStar && lostStar <= 3) { proto.addCondDataList( @@ -26,15 +24,9 @@ public class PacketTowerLevelStarCondNotify extends BasePacket { .build()); } else { proto - .addCondDataList( - TowerLevelStarCondData.newBuilder() - .build()) - .addCondDataList( - TowerLevelStarCondData.newBuilder() - .build()) - .addCondDataList( - TowerLevelStarCondData.newBuilder() - .build()); + .addCondDataList(TowerLevelStarCondData.newBuilder().build()) + .addCondDataList(TowerLevelStarCondData.newBuilder().build()) + .addCondDataList(TowerLevelStarCondData.newBuilder().build()); } this.setData(proto.build());