Commit 96da4b61 authored by github-actions's avatar github-actions
Browse files

Fix whitespace [skip actions]

parent 026ef9c5
......@@ -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;
......
......@@ -20,9 +20,9 @@ public class CookRecipeData extends GameResource {
@Getter List<ItemParamData> inputVec;
@Override
public int getId() {
return this.id;
}
public int getId() {
return this.id;
}
@Override
public void onLoad() {
}
......
......@@ -4,88 +4,88 @@ import dev.morphia.annotations.Entity;
@Entity
public class ActiveForgeData {
private int forgeId;
private int avatarId;
private int count;
private int startTime;
private int forgeTime;
private int lastUnfinishedCount;
private boolean changed;
public int getFinishedCount(int currentTime) {
int timeDelta = currentTime - this.startTime;
int finishedCount = timeDelta / this.forgeTime;
return Math.min(finishedCount, this.count);
}
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 getTotalFinishTimestamp() {
return this.startTime + this.forgeTime * this.count;
}
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 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 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 updateChanged(int currentTime) {
int currentUnfinished = this.getUnfinishedCount(currentTime);
if (currentUnfinished != this.lastUnfinishedCount) {
this.changed = true;
this.lastUnfinishedCount = currentUnfinished;
}
return this.changed;
}
private int forgeId;
private int avatarId;
private int count;
private int startTime;
private int forgeTime;
private int lastUnfinishedCount;
private boolean changed;
public int getFinishedCount(int currentTime) {
int timeDelta = currentTime - this.startTime;
int finishedCount = timeDelta / this.forgeTime;
return Math.min(finishedCount, this.count);
}
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 getTotalFinishTimestamp() {
return this.startTime + this.forgeTime * this.count;
}
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 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 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 updateChanged(int currentTime) {
int currentUnfinished = this.getUnfinishedCount(currentTime);
if (currentUnfinished != this.lastUnfinishedCount) {
this.changed = true;
this.lastUnfinishedCount = currentUnfinished;
}
return this.changed;
}
}
......@@ -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");
......
......@@ -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);
}
}
......@@ -12,7 +12,7 @@ public class PacketForgeStartRsp extends BasePacket {
ForgeStartRsp proto = ForgeStartRsp.newBuilder()
.setRetcode(retcode.getNumber())
.build();
.build();
this.setData(proto);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment