From d461ee2eb3f9a58934bb5d0c49a3621e35767de7 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 02:02:24 +0000 Subject: [PATCH] Format code [skip actions] --- .../game/dungeons/TowerDungeonSettleListener.java | 10 +++++----- .../game/dungeons/challenge/WorldChallenge.java | 4 +++- .../game/dungeons/challenge/trigger/GuardTrigger.java | 8 +++++--- .../java/emu/grasscutter/game/entity/EntityGadget.java | 10 +++++++--- .../emu/grasscutter/scripts/SceneScriptManager.java | 6 +++--- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/dungeons/TowerDungeonSettleListener.java b/src/main/java/emu/grasscutter/game/dungeons/TowerDungeonSettleListener.java index 6e32363b6..bed5d7c05 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/TowerDungeonSettleListener.java +++ b/src/main/java/emu/grasscutter/game/dungeons/TowerDungeonSettleListener.java @@ -37,11 +37,11 @@ public class TowerDungeonSettleListener implements DungeonSettleListener { var challenge = scene.getChallenge(); var finishedTime = challenge == null ? challenge.getFinishedTime() : 0; var dungeonStats = - new DungeonEndStats( - scene.getKilledMonsterCount(), finishedTime, 0, endReason); - var result = endReason == DungeonEndReason.COMPLETED ? - new TowerResult(dungeonData, dungeonStats, towerManager, challenge, stars) : - new BaseDungeonResult(dungeonData, dungeonStats); + new DungeonEndStats(scene.getKilledMonsterCount(), finishedTime, 0, endReason); + var result = + endReason == DungeonEndReason.COMPLETED + ? new TowerResult(dungeonData, dungeonStats, towerManager, challenge, stars) + : new BaseDungeonResult(dungeonData, dungeonStats); scene.broadcastPacket(new PacketDungeonSettleNotify(result)); } diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/WorldChallenge.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/WorldChallenge.java index b20c2cb99..b95a4be5a 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/WorldChallenge.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/WorldChallenge.java @@ -159,7 +159,9 @@ public class WorldChallenge { public int getGuardEntityHpPercent() { if (guardEntity == null) { - Grasscutter.getLogger().warn("getGuardEntityHpPercent: Could not find guardEntity for this challenge = {}", this); + Grasscutter.getLogger() + .warn( + "getGuardEntityHpPercent: Could not find guardEntity for this challenge = {}", this); return 100; } diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/trigger/GuardTrigger.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/trigger/GuardTrigger.java index a515f3501..18b370cf9 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/trigger/GuardTrigger.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/trigger/GuardTrigger.java @@ -2,7 +2,6 @@ package emu.grasscutter.game.dungeons.challenge.trigger; import emu.grasscutter.game.dungeons.challenge.WorldChallenge; import emu.grasscutter.game.entity.EntityGadget; -import emu.grasscutter.game.props.FightProperty; import emu.grasscutter.server.packet.send.PacketChallengeDataNotify; public class GuardTrigger extends ChallengeTrigger { @@ -14,9 +13,12 @@ public class GuardTrigger extends ChallengeTrigger { } public void onBegin(WorldChallenge challenge) { - challenge.setGuardEntity(challenge.getScene().getEntityByConfigId(entityToProtectCFGId, challenge.getGroup().id)); + challenge.setGuardEntity( + challenge.getScene().getEntityByConfigId(entityToProtectCFGId, challenge.getGroup().id)); lastSendPercent = challenge.getGuardEntityHpPercent(); - challenge.getScene().broadcastPacket(new PacketChallengeDataNotify(challenge, 2, lastSendPercent)); + challenge + .getScene() + .broadcastPacket(new PacketChallengeDataNotify(challenge, 2, lastSendPercent)); } @Override diff --git a/src/main/java/emu/grasscutter/game/entity/EntityGadget.java b/src/main/java/emu/grasscutter/game/entity/EntityGadget.java index 6597f48c5..e2510d74f 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityGadget.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityGadget.java @@ -4,7 +4,6 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.data.GameData; import emu.grasscutter.data.binout.config.ConfigEntityGadget; import emu.grasscutter.data.binout.config.fields.ConfigAbilityData; -import emu.grasscutter.data.common.PropGrowCurve; import emu.grasscutter.data.excels.GadgetData; import emu.grasscutter.data.excels.monster.MonsterCurveData; import emu.grasscutter.game.entity.gadget.*; @@ -113,9 +112,14 @@ public class EntityGadget extends EntityBaseGadget { if (gadgetData.getJsonName().equals("SceneObj_Gear_Operator_Mamolu_Entity")) { MonsterCurveData curve = GameData.getMonsterCurveDataMap().get(11); if (curve != null) { - FightProperty[] hpProps = {FightProperty.FIGHT_PROP_MAX_HP, FightProperty.FIGHT_PROP_BASE_HP, FightProperty.FIGHT_PROP_CUR_HP}; + FightProperty[] hpProps = { + FightProperty.FIGHT_PROP_MAX_HP, + FightProperty.FIGHT_PROP_BASE_HP, + FightProperty.FIGHT_PROP_CUR_HP + }; for (var prop : hpProps) { - setFightProperty(prop, this.getFightProperty(prop) * curve.getMultByProp("GROW_CURVE_HP_ENVIRONMENT")); + setFightProperty( + prop, this.getFightProperty(prop) * curve.getMultByProp("GROW_CURVE_HP_ENVIRONMENT")); } } } diff --git a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java index ec033dec7..71f40da24 100644 --- a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java +++ b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java @@ -971,8 +971,7 @@ public class SceneScriptManager { // or the trigger should be preserved after a RefreshGroup call if (trigger.isPreserved()) { trigger.setPreserved(false); - } - else if (ret.isboolean() && !ret.checkboolean() + } else if (ret.isboolean() && !ret.checkboolean() || ret.isint() && ret.checkint() != 0 || trigger.getTrigger_count() > 0 && invocations >= trigger.getTrigger_count()) { deregisterTrigger(trigger); @@ -1122,7 +1121,8 @@ public class SceneScriptManager { } public void removeMonstersInGroup(SceneGroup group) { - var configSet = group.monsters.values().stream().map(m -> m.config_id).collect(Collectors.toSet()); + var configSet = + group.monsters.values().stream().map(m -> m.config_id).collect(Collectors.toSet()); var toRemove = getScene().getEntities().values().stream() .filter(e -> e instanceof EntityMonster)