From b1b8abc6270c6bc1c24c51b9f0f5e03a955b5ae7 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 1 Jun 2023 01:06:12 +0000 Subject: [PATCH] Format code [skip actions] --- .../java/emu/grasscutter/game/avatar/Avatar.java | 14 ++++++-------- .../emu/grasscutter/game/inventory/Inventory.java | 5 ++--- .../grasscutter/game/player/BasePlayerManager.java | 1 + src/main/java/emu/grasscutter/utils/Utils.java | 14 ++++++-------- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/avatar/Avatar.java b/src/main/java/emu/grasscutter/game/avatar/Avatar.java index 91500b0e7..b87f32272 100644 --- a/src/main/java/emu/grasscutter/game/avatar/Avatar.java +++ b/src/main/java/emu/grasscutter/game/avatar/Avatar.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.avatar; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; + import dev.morphia.annotations.*; import emu.grasscutter.GameConstants; import emu.grasscutter.data.GameData; @@ -30,14 +32,11 @@ import emu.grasscutter.net.proto.TrialAvatarInfoOuterClass.TrialAvatarInfo; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.helpers.ProtoHelper; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; -import org.bson.types.ObjectId; - -import javax.annotation.*; import java.util.*; import java.util.stream.Stream; - -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; +import javax.annotation.*; +import lombok.*; +import org.bson.types.ObjectId; @Entity(value = "avatars", useDiscriminator = false) public class Avatar { @@ -230,8 +229,7 @@ public class Avatar { /** * @return The avatar's equipped weapon. */ - @Nullable - public GameItem getWeapon() { + @Nullable public GameItem getWeapon() { return this.getEquipBySlot(EquipType.EQUIP_WEAPON); } diff --git a/src/main/java/emu/grasscutter/game/inventory/Inventory.java b/src/main/java/emu/grasscutter/game/inventory/Inventory.java index db82991a9..1fd24beea 100644 --- a/src/main/java/emu/grasscutter/game/inventory/Inventory.java +++ b/src/main/java/emu/grasscutter/game/inventory/Inventory.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.inventory; +import static emu.grasscutter.config.Configuration.INVENTORY_LIMITS; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.GameData; import emu.grasscutter.data.common.ItemParamData; @@ -15,11 +17,8 @@ import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.longs.*; - import java.util.*; -import static emu.grasscutter.config.Configuration.INVENTORY_LIMITS; - public class Inventory extends BasePlayerManager implements Iterable { private final Long2ObjectMap store; private final Int2ObjectMap inventoryTypes; diff --git a/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java b/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java index cf97f9ecd..1a42840b5 100644 --- a/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java +++ b/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java @@ -4,6 +4,7 @@ import lombok.*; public abstract class BasePlayerManager { protected final transient Player player; + @Getter @Setter(AccessLevel.PROTECTED) protected boolean loaded = false; diff --git a/src/main/java/emu/grasscutter/utils/Utils.java b/src/main/java/emu/grasscutter/utils/Utils.java index 46f4c422b..6edb3201c 100644 --- a/src/main/java/emu/grasscutter/utils/Utils.java +++ b/src/main/java/emu/grasscutter/utils/Utils.java @@ -1,5 +1,8 @@ package emu.grasscutter.utils; +import static emu.grasscutter.utils.FileUtils.getResourcePath; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.config.ConfigContainer; import emu.grasscutter.data.DataLoader; @@ -8,9 +11,6 @@ import emu.grasscutter.utils.objects.Returnable; import io.javalin.http.Context; import io.netty.buffer.*; import it.unimi.dsi.fastutil.ints.*; -import org.slf4j.Logger; - -import javax.annotation.Nullable; import java.io.*; import java.nio.charset.StandardCharsets; import java.nio.file.*; @@ -18,9 +18,8 @@ import java.time.*; import java.time.temporal.TemporalAdjusters; import java.util.*; import java.util.concurrent.ThreadLocalRandom; - -import static emu.grasscutter.utils.FileUtils.getResourcePath; -import static emu.grasscutter.utils.lang.Language.translate; +import javax.annotation.Nullable; +import org.slf4j.Logger; @SuppressWarnings({"UnusedReturnValue", "BooleanMethodIsAlwaysInverted"}) public final class Utils { @@ -481,8 +480,7 @@ public final class Utils { } /** - * Waits for the task to return true. - * This will halt the thread until the task returns true. + * Waits for the task to return true. This will halt the thread until the task returns true. * * @param runnable The task to run. */