diff --git a/src/main/java/emu/grasscutter/data/binout/AbilityModifier.java b/src/main/java/emu/grasscutter/data/binout/AbilityModifier.java index 6706f068a..8342aa2a3 100644 --- a/src/main/java/emu/grasscutter/data/binout/AbilityModifier.java +++ b/src/main/java/emu/grasscutter/data/binout/AbilityModifier.java @@ -4,9 +4,10 @@ import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.common.DynamicFloat; import emu.grasscutter.game.props.ElementType; import emu.grasscutter.utils.objects.DropType; -import java.io.Serializable; import lombok.ToString; +import java.io.Serializable; + public class AbilityModifier implements Serializable { private static final long serialVersionUID = -2001232313615923575L; diff --git a/src/main/java/emu/grasscutter/utils/JsonAdapters.java b/src/main/java/emu/grasscutter/utils/JsonAdapters.java index 6ff9b99cd..926e2681d 100644 --- a/src/main/java/emu/grasscutter/utils/JsonAdapters.java +++ b/src/main/java/emu/grasscutter/utils/JsonAdapters.java @@ -8,10 +8,11 @@ import emu.grasscutter.game.world.*; import emu.grasscutter.utils.objects.DropType; import it.unimi.dsi.fastutil.floats.FloatArrayList; import it.unimi.dsi.fastutil.ints.*; +import lombok.val; + import java.io.IOException; import java.lang.reflect.Field; import java.util.*; -import lombok.val; public interface JsonAdapters { class DynamicFloatAdapter extends TypeAdapter { @@ -55,7 +56,8 @@ public interface JsonAdapters { class DropTypeAdapter extends TypeAdapter { @Override public void write(JsonWriter out, DropType value) throws IOException { - if (value.isString()) out.value(value.getAsString()); + if (value.isString()) + out.value(value.getAsString()); else out.value(value.getAsInt()); } diff --git a/src/main/java/emu/grasscutter/utils/JsonUtils.java b/src/main/java/emu/grasscutter/utils/JsonUtils.java index ec11fd348..8e9a7e957 100644 --- a/src/main/java/emu/grasscutter/utils/JsonUtils.java +++ b/src/main/java/emu/grasscutter/utils/JsonUtils.java @@ -7,6 +7,7 @@ import emu.grasscutter.game.world.*; import emu.grasscutter.utils.JsonAdapters.*; import emu.grasscutter.utils.objects.*; import it.unimi.dsi.fastutil.ints.IntList; + import java.io.*; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; diff --git a/src/main/java/emu/grasscutter/utils/objects/DropType.java b/src/main/java/emu/grasscutter/utils/objects/DropType.java index 6a59867bd..55762e1e9 100644 --- a/src/main/java/emu/grasscutter/utils/objects/DropType.java +++ b/src/main/java/emu/grasscutter/utils/objects/DropType.java @@ -14,11 +14,10 @@ public final class DropType { public DropType(String value) { this.raw = value; - this.value = - switch (value) { - default -> Integer.parseInt(value); - case "ForceDrop" -> 2; - }; + this.value = switch (value) { + default -> Integer.parseInt(value); + case "ForceDrop" -> 2; + }; } /** @@ -32,7 +31,8 @@ public final class DropType { * @return The drop type value as a string. */ public String getAsString() { - if (this.raw instanceof String) return (String) this.raw; + if (this.raw instanceof String) + return (String) this.raw; throw new UnsupportedOperationException(); } @@ -40,7 +40,8 @@ public final class DropType { * @return The drop type value as an integer. */ public int getAsInt() { - if (this.raw instanceof Integer) return (int) this.raw; + if (this.raw instanceof Integer) + return (int) this.raw; throw new UnsupportedOperationException(); } }