From 3f4578c0baf37ba7bac15880dbd0825a6f4d563f Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 May 2023 01:13:53 +0000 Subject: [PATCH] Format code [skip actions] --- .../emu/grasscutter/data/excels/TalkConfigData.java | 7 +++---- .../emu/grasscutter/game/ability/AbilityManager.java | 5 ++--- .../condition/BasicActivityConditionExecutor.java | 3 ++- .../all/UnknownActivityConditionHandler.java | 3 +-- .../java/emu/grasscutter/game/talk/TalkManager.java | 11 +++++------ .../grasscutter/server/game/GameSessionManager.java | 5 ++--- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/main/java/emu/grasscutter/data/excels/TalkConfigData.java b/src/main/java/emu/grasscutter/data/excels/TalkConfigData.java index 66d27f56f..27c01116d 100644 --- a/src/main/java/emu/grasscutter/data/excels/TalkConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/TalkConfigData.java @@ -4,11 +4,10 @@ import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.GameResource; import emu.grasscutter.data.ResourceType; import emu.grasscutter.game.talk.TalkExec; +import java.util.List; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.List; - @ResourceType(name = "TalkExcelConfigData.json") @EqualsAndHashCode(callSuper = false) @Data @@ -29,8 +28,8 @@ public final class TalkConfigData extends GameResource { private int questId; @SerializedName( - value = "npcId", - alternate = {"_npcId"}) + value = "npcId", + alternate = {"_npcId"}) private List npcId; @Override diff --git a/src/main/java/emu/grasscutter/game/ability/AbilityManager.java b/src/main/java/emu/grasscutter/game/ability/AbilityManager.java index 281c470df..3bbee7cd8 100644 --- a/src/main/java/emu/grasscutter/game/ability/AbilityManager.java +++ b/src/main/java/emu/grasscutter/game/ability/AbilityManager.java @@ -21,15 +21,14 @@ import emu.grasscutter.net.proto.AbilityMixinCostStaminaOuterClass.AbilityMixinC import emu.grasscutter.net.proto.AbilityScalarValueEntryOuterClass.AbilityScalarValueEntry; import emu.grasscutter.net.proto.ModifierActionOuterClass.ModifierAction; import io.netty.util.concurrent.FastThreadLocalThread; -import lombok.Getter; -import org.reflections.Reflections; - import java.util.HashMap; import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import lombok.Getter; +import org.reflections.Reflections; public final class AbilityManager extends BasePlayerManager { public static final ExecutorService eventExecutor; diff --git a/src/main/java/emu/grasscutter/game/activity/condition/BasicActivityConditionExecutor.java b/src/main/java/emu/grasscutter/game/activity/condition/BasicActivityConditionExecutor.java index d4eef1254..c0ea940ac 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/BasicActivityConditionExecutor.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/BasicActivityConditionExecutor.java @@ -63,7 +63,8 @@ public class BasicActivityConditionExecutor implements ActivityConditionExecutor (BooleanSupplier) () -> activityConditionsHandlers - .getOrDefault(c.getType(), new UnknownActivityConditionHandler(c.getType())) + .getOrDefault( + c.getType(), new UnknownActivityConditionHandler(c.getType())) .execute(activity, activityConfig, c.paramArray())) .collect(Collectors.toList()); diff --git a/src/main/java/emu/grasscutter/game/activity/condition/all/UnknownActivityConditionHandler.java b/src/main/java/emu/grasscutter/game/activity/condition/all/UnknownActivityConditionHandler.java index b3e9b1a41..80501b52c 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/all/UnknownActivityConditionHandler.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/all/UnknownActivityConditionHandler.java @@ -15,8 +15,7 @@ public class UnknownActivityConditionHandler extends ActivityConditionBaseHandle @Override public boolean execute( PlayerActivityData activityData, ActivityConfigItem activityConfig, int... params) { - Grasscutter.getLogger().error("Called unknown condition handler {}.", - conditions.name()); + Grasscutter.getLogger().error("Called unknown condition handler {}.", conditions.name()); return false; } } diff --git a/src/main/java/emu/grasscutter/game/talk/TalkManager.java b/src/main/java/emu/grasscutter/game/talk/TalkManager.java index 8a613834c..7aa01b8e8 100644 --- a/src/main/java/emu/grasscutter/game/talk/TalkManager.java +++ b/src/main/java/emu/grasscutter/game/talk/TalkManager.java @@ -1,15 +1,15 @@ package emu.grasscutter.game.talk; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_COMPLETE_TALK; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_COMPLETE_ANY_TALK; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_COMPLETE_TALK; + import emu.grasscutter.data.GameData; import emu.grasscutter.data.binout.MainQuestData.TalkData; import emu.grasscutter.game.player.BasePlayerManager; import emu.grasscutter.game.player.Player; import lombok.NonNull; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_COMPLETE_TALK; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_COMPLETE_ANY_TALK; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_COMPLETE_TALK; - public final class TalkManager extends BasePlayerManager { public TalkManager(@NonNull Player player) { super(player); @@ -31,8 +31,7 @@ public final class TalkManager extends BasePlayerManager { if (entity == null) return; // The config ID of the entity is the NPC's ID. - if (!talkData.getNpcId().contains(entity.getConfigId())) - return; + if (!talkData.getNpcId().contains(entity.getConfigId())) return; // Execute the talk action on associated handlers. talkData diff --git a/src/main/java/emu/grasscutter/server/game/GameSessionManager.java b/src/main/java/emu/grasscutter/server/game/GameSessionManager.java index fde9317fd..b8df6a69e 100644 --- a/src/main/java/emu/grasscutter/server/game/GameSessionManager.java +++ b/src/main/java/emu/grasscutter/server/game/GameSessionManager.java @@ -5,11 +5,10 @@ import emu.grasscutter.utils.Utils; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.DefaultEventLoop; -import kcp.highway.KcpListener; -import kcp.highway.Ukcp; - import java.net.InetSocketAddress; import java.util.concurrent.ConcurrentHashMap; +import kcp.highway.KcpListener; +import kcp.highway.Ukcp; public class GameSessionManager { private static final DefaultEventLoop logicThread = new DefaultEventLoop();