Revert "Run spotlessApply"

This reverts commit d67e2d0c5e.
This commit is contained in:
KingRainbow44
2023-05-03 10:48:00 -04:00
parent 40a7d088d0
commit 3df5f79ebf
1412 changed files with 1213844 additions and 1308701 deletions

View File

@@ -41,7 +41,11 @@ public final class GridPosition implements Serializable {
@SneakyThrows
public GridPosition(String str) {
var listOfParams = str.replace(" ", "").replace("(", "").replace(")", "").split(",");
var listOfParams = str
.replace(" ", "")
.replace("(", "")
.replace(")", "")
.split(",");
if (listOfParams.length != 3)
throw new IOException("invalid size on GridPosition definition - ");
try {

View File

@@ -90,14 +90,20 @@ public class JsonAdapters {
// GridPosition follows the format of: (x, y, z).
// Flatten to (x,y,z) for easier parsing.
var str = in.nextString().replace("(", "").replace(")", "").replace(" ", "");
var str = in.nextString()
.replace("(", "")
.replace(")", "")
.replace(" ", "");
var split = str.split(",");
if (split.length != 3)
throw new IOException("Invalid GridPosition definition - " + in.peek().name());
return new GridPosition(
Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2]));
Integer.parseInt(split[0]),
Integer.parseInt(split[1]),
Integer.parseInt(split[2])
);
}
}

View File

@@ -22,13 +22,13 @@ import java.util.Map;
public final class JsonUtils {
static final Gson gson =
new GsonBuilder()
.setPrettyPrinting()
.registerTypeAdapter(DynamicFloat.class, new DynamicFloatAdapter())
.registerTypeAdapter(IntList.class, new IntListAdapter())
.registerTypeAdapter(Position.class, new PositionAdapter())
.registerTypeAdapter(GridPosition.class, new GridPositionAdapter())
.registerTypeAdapterFactory(new EnumTypeAdapterFactory())
.create();
.setPrettyPrinting()
.registerTypeAdapter(DynamicFloat.class, new DynamicFloatAdapter())
.registerTypeAdapter(IntList.class, new IntListAdapter())
.registerTypeAdapter(Position.class, new PositionAdapter())
.registerTypeAdapter(GridPosition.class, new GridPositionAdapter())
.registerTypeAdapterFactory(new EnumTypeAdapterFactory())
.create();
/*
* Encode an object to a JSON string