diff --git a/src/main/java/emu/grasscutter/data/excels/CompoundData.java b/src/main/java/emu/grasscutter/data/excels/CompoundData.java index e6eab7ab6..c90f6baaa 100644 --- a/src/main/java/emu/grasscutter/data/excels/CompoundData.java +++ b/src/main/java/emu/grasscutter/data/excels/CompoundData.java @@ -12,7 +12,7 @@ public class CompoundData extends GameResource { private int id; @Override - public int getId(){return this.id;} + public int getId() {return this.id;} @Getter private int groupId; @Getter private int rankLevel; @Getter private boolean isDefaultUnlocked; diff --git a/src/main/java/emu/grasscutter/data/excels/CookRecipeData.java b/src/main/java/emu/grasscutter/data/excels/CookRecipeData.java index d9bc89b1d..b8c8a4946 100644 --- a/src/main/java/emu/grasscutter/data/excels/CookRecipeData.java +++ b/src/main/java/emu/grasscutter/data/excels/CookRecipeData.java @@ -20,9 +20,9 @@ public class CookRecipeData extends GameResource { @Getter List inputVec; @Override - public int getId() { - return this.id; - } + public int getId() { + return this.id; + } @Override public void onLoad() { } diff --git a/src/main/java/emu/grasscutter/game/managers/forging/ActiveForgeData.java b/src/main/java/emu/grasscutter/game/managers/forging/ActiveForgeData.java index e04f23bad..ff5048c7f 100644 --- a/src/main/java/emu/grasscutter/game/managers/forging/ActiveForgeData.java +++ b/src/main/java/emu/grasscutter/game/managers/forging/ActiveForgeData.java @@ -4,88 +4,88 @@ import dev.morphia.annotations.Entity; @Entity public class ActiveForgeData { - private int forgeId; - private int avatarId; - private int count; + private int forgeId; + private int avatarId; + private int count; - private int startTime; - private int forgeTime; + private int startTime; + private int forgeTime; - private int lastUnfinishedCount; - private boolean changed; + private int lastUnfinishedCount; + private boolean changed; - public int getFinishedCount(int currentTime) { - int timeDelta = currentTime - this.startTime; - int finishedCount = timeDelta / this.forgeTime; + public int getFinishedCount(int currentTime) { + int timeDelta = currentTime - this.startTime; + int finishedCount = timeDelta / this.forgeTime; - return Math.min(finishedCount, this.count); - } + return Math.min(finishedCount, this.count); + } - public int getUnfinishedCount(int currentTime) { - return this.count - this.getFinishedCount(currentTime); - } + public int getUnfinishedCount(int currentTime) { + return this.count - this.getFinishedCount(currentTime); + } - public int getNextFinishTimestamp(int currentTime) { - return - (currentTime >= this.getTotalFinishTimestamp()) - ? this.getTotalFinishTimestamp() - : (this.getFinishedCount(currentTime) * this.forgeTime + this.forgeTime + this.startTime); - } + public int getNextFinishTimestamp(int currentTime) { + return + (currentTime >= this.getTotalFinishTimestamp()) + ? this.getTotalFinishTimestamp() + : (this.getFinishedCount(currentTime) * this.forgeTime + this.forgeTime + this.startTime); + } - public int getTotalFinishTimestamp() { - return this.startTime + this.forgeTime * this.count; - } + public int getTotalFinishTimestamp() { + return this.startTime + this.forgeTime * this.count; + } - public int getForgeId() { - return this.forgeId; - } - public void setForgeId(int value) { - this.forgeId = value; - } + public int getForgeId() { + return this.forgeId; + } + public void setForgeId(int value) { + this.forgeId = value; + } - public int getAvatarId() { - return this.avatarId; - } - public void setAvatarId(int value) { - this.avatarId = value; - } + public int getAvatarId() { + return this.avatarId; + } + public void setAvatarId(int value) { + this.avatarId = value; + } - public int getCount() { - return count; - } - public void setCount(int value) { - this.count = value; - } + public int getCount() { + return count; + } + public void setCount(int value) { + this.count = value; + } - public int getStartTime() { - return this.startTime; - } - public void setStartTime(int value) { - this.startTime = value; - } + public int getStartTime() { + return this.startTime; + } + public void setStartTime(int value) { + this.startTime = value; + } - public int getForgeTime() { - return this.forgeTime; - } - public void setForgeTime(int value) { - this.forgeTime = value; - } + public int getForgeTime() { + return this.forgeTime; + } + public void setForgeTime(int value) { + this.forgeTime = value; + } - public boolean isChanged() { - return this.changed; - } - public void setChanged(boolean value) { - this.changed = value; - } + public boolean isChanged() { + return this.changed; + } + public void setChanged(boolean value) { + this.changed = value; + } - public boolean updateChanged(int currentTime) { - int currentUnfinished = this.getUnfinishedCount(currentTime); + public boolean updateChanged(int currentTime) { + int currentUnfinished = this.getUnfinishedCount(currentTime); - if (currentUnfinished != this.lastUnfinishedCount) { - this.changed = true; - this.lastUnfinishedCount = currentUnfinished; - } + if (currentUnfinished != this.lastUnfinishedCount) { + this.changed = true; + this.lastUnfinishedCount = currentUnfinished; + } - return this.changed; - } + return this.changed; + } } diff --git a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java index 294decdac..99ff71b5d 100644 --- a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java +++ b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java @@ -155,7 +155,7 @@ public final class RegionHandler implements Router { String key_id = ctx.queryParam("key_id"); - if(key_id == null) + if (key_id == null) throw new Exception("Key ID was not set"); Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketDestroyMaterialRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketDestroyMaterialRsp.java index 3fcc2d627..373ab0539 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketDestroyMaterialRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketDestroyMaterialRsp.java @@ -6,17 +6,17 @@ import emu.grasscutter.net.proto.DestroyMaterialRspOuterClass.DestroyMaterialRsp import it.unimi.dsi.fastutil.ints.Int2IntMap; public class PacketDestroyMaterialRsp extends BasePacket { - - public PacketDestroyMaterialRsp(Int2IntMap returnMaterialMap) { - super(PacketOpcodes.DestroyMaterialRsp); - + + public PacketDestroyMaterialRsp(Int2IntMap returnMaterialMap) { + super(PacketOpcodes.DestroyMaterialRsp); + var proto = DestroyMaterialRsp.newBuilder(); - + returnMaterialMap.forEach((id, count) -> { proto.addItemIdList(id); proto.addItemCountList(count); }); - - this.setData(proto); - } + + this.setData(proto); + } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeStartRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeStartRsp.java index bd7ba37a0..08f8ed034 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeStartRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeStartRsp.java @@ -12,7 +12,7 @@ public class PacketForgeStartRsp extends BasePacket { ForgeStartRsp proto = ForgeStartRsp.newBuilder() .setRetcode(retcode.getNumber()) - .build(); + .build(); this.setData(proto); }