mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 15:22:16 +00:00
Fix whitespace [skip actions]
This commit is contained in:
parent
026ef9c51b
commit
96da4b6117
@ -12,7 +12,7 @@ public class CompoundData extends GameResource {
|
|||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId(){return this.id;}
|
public int getId() {return this.id;}
|
||||||
@Getter private int groupId;
|
@Getter private int groupId;
|
||||||
@Getter private int rankLevel;
|
@Getter private int rankLevel;
|
||||||
@Getter private boolean isDefaultUnlocked;
|
@Getter private boolean isDefaultUnlocked;
|
||||||
|
@ -20,9 +20,9 @@ public class CookRecipeData extends GameResource {
|
|||||||
@Getter List<ItemParamData> inputVec;
|
@Getter List<ItemParamData> inputVec;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
}
|
}
|
||||||
|
@ -4,88 +4,88 @@ import dev.morphia.annotations.Entity;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class ActiveForgeData {
|
public class ActiveForgeData {
|
||||||
private int forgeId;
|
private int forgeId;
|
||||||
private int avatarId;
|
private int avatarId;
|
||||||
private int count;
|
private int count;
|
||||||
|
|
||||||
private int startTime;
|
private int startTime;
|
||||||
private int forgeTime;
|
private int forgeTime;
|
||||||
|
|
||||||
private int lastUnfinishedCount;
|
private int lastUnfinishedCount;
|
||||||
private boolean changed;
|
private boolean changed;
|
||||||
|
|
||||||
public int getFinishedCount(int currentTime) {
|
public int getFinishedCount(int currentTime) {
|
||||||
int timeDelta = currentTime - this.startTime;
|
int timeDelta = currentTime - this.startTime;
|
||||||
int finishedCount = timeDelta / this.forgeTime;
|
int finishedCount = timeDelta / this.forgeTime;
|
||||||
|
|
||||||
return Math.min(finishedCount, this.count);
|
return Math.min(finishedCount, this.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUnfinishedCount(int currentTime) {
|
public int getUnfinishedCount(int currentTime) {
|
||||||
return this.count - this.getFinishedCount(currentTime);
|
return this.count - this.getFinishedCount(currentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextFinishTimestamp(int currentTime) {
|
public int getNextFinishTimestamp(int currentTime) {
|
||||||
return
|
return
|
||||||
(currentTime >= this.getTotalFinishTimestamp())
|
(currentTime >= this.getTotalFinishTimestamp())
|
||||||
? this.getTotalFinishTimestamp()
|
? this.getTotalFinishTimestamp()
|
||||||
: (this.getFinishedCount(currentTime) * this.forgeTime + this.forgeTime + this.startTime);
|
: (this.getFinishedCount(currentTime) * this.forgeTime + this.forgeTime + this.startTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTotalFinishTimestamp() {
|
public int getTotalFinishTimestamp() {
|
||||||
return this.startTime + this.forgeTime * this.count;
|
return this.startTime + this.forgeTime * this.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getForgeId() {
|
public int getForgeId() {
|
||||||
return this.forgeId;
|
return this.forgeId;
|
||||||
}
|
}
|
||||||
public void setForgeId(int value) {
|
public void setForgeId(int value) {
|
||||||
this.forgeId = value;
|
this.forgeId = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAvatarId() {
|
public int getAvatarId() {
|
||||||
return this.avatarId;
|
return this.avatarId;
|
||||||
}
|
}
|
||||||
public void setAvatarId(int value) {
|
public void setAvatarId(int value) {
|
||||||
this.avatarId = value;
|
this.avatarId = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
public void setCount(int value) {
|
public void setCount(int value) {
|
||||||
this.count = value;
|
this.count = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getStartTime() {
|
public int getStartTime() {
|
||||||
return this.startTime;
|
return this.startTime;
|
||||||
}
|
}
|
||||||
public void setStartTime(int value) {
|
public void setStartTime(int value) {
|
||||||
this.startTime = value;
|
this.startTime = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getForgeTime() {
|
public int getForgeTime() {
|
||||||
return this.forgeTime;
|
return this.forgeTime;
|
||||||
}
|
}
|
||||||
public void setForgeTime(int value) {
|
public void setForgeTime(int value) {
|
||||||
this.forgeTime = value;
|
this.forgeTime = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isChanged() {
|
public boolean isChanged() {
|
||||||
return this.changed;
|
return this.changed;
|
||||||
}
|
}
|
||||||
public void setChanged(boolean value) {
|
public void setChanged(boolean value) {
|
||||||
this.changed = value;
|
this.changed = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean updateChanged(int currentTime) {
|
public boolean updateChanged(int currentTime) {
|
||||||
int currentUnfinished = this.getUnfinishedCount(currentTime);
|
int currentUnfinished = this.getUnfinishedCount(currentTime);
|
||||||
|
|
||||||
if (currentUnfinished != this.lastUnfinishedCount) {
|
if (currentUnfinished != this.lastUnfinishedCount) {
|
||||||
this.changed = true;
|
this.changed = true;
|
||||||
this.lastUnfinishedCount = currentUnfinished;
|
this.lastUnfinishedCount = currentUnfinished;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.changed;
|
return this.changed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public final class RegionHandler implements Router {
|
|||||||
|
|
||||||
String key_id = ctx.queryParam("key_id");
|
String key_id = ctx.queryParam("key_id");
|
||||||
|
|
||||||
if(key_id == null)
|
if (key_id == null)
|
||||||
throw new Exception("Key ID was not set");
|
throw new Exception("Key ID was not set");
|
||||||
|
|
||||||
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
|
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;
|
import it.unimi.dsi.fastutil.ints.Int2IntMap;
|
||||||
|
|
||||||
public class PacketDestroyMaterialRsp extends BasePacket {
|
public class PacketDestroyMaterialRsp extends BasePacket {
|
||||||
|
|
||||||
public PacketDestroyMaterialRsp(Int2IntMap returnMaterialMap) {
|
public PacketDestroyMaterialRsp(Int2IntMap returnMaterialMap) {
|
||||||
super(PacketOpcodes.DestroyMaterialRsp);
|
super(PacketOpcodes.DestroyMaterialRsp);
|
||||||
|
|
||||||
var proto = DestroyMaterialRsp.newBuilder();
|
var proto = DestroyMaterialRsp.newBuilder();
|
||||||
|
|
||||||
returnMaterialMap.forEach((id, count) -> {
|
returnMaterialMap.forEach((id, count) -> {
|
||||||
proto.addItemIdList(id);
|
proto.addItemIdList(id);
|
||||||
proto.addItemCountList(count);
|
proto.addItemCountList(count);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.setData(proto);
|
this.setData(proto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ public class PacketForgeStartRsp extends BasePacket {
|
|||||||
|
|
||||||
ForgeStartRsp proto = ForgeStartRsp.newBuilder()
|
ForgeStartRsp proto = ForgeStartRsp.newBuilder()
|
||||||
.setRetcode(retcode.getNumber())
|
.setRetcode(retcode.getNumber())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
this.setData(proto);
|
this.setData(proto);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user