Skip to content

Commit

Permalink
lastRaidTime primitive
Browse files Browse the repository at this point in the history
  • Loading branch information
AubriTheHuman committed Apr 18, 2023
1 parent c2595bc commit 16add93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/main/java/me/ShermansWorld/AlathraWar/War.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class War {
// References
private ArrayList<Siege> sieges = new ArrayList<Siege>();
private ArrayList<Raid> raids = new ArrayList<Raid>();
private Long lastRaidTime = 0L;
private long lastRaidTime = 0L;

/**
* War Constructor
Expand Down Expand Up @@ -213,10 +213,7 @@ public void setLastRaidTime(Long lastRaidTime) {
this.lastRaidTime = lastRaidTime;
}

public Long getLastRaidTime() {
if(lastRaidTime == null) {
lastRaidTime = 0L;
}
public long getLastRaidTime() {
return this.lastRaidTime;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public static int isValidRaid(War war, @Nonnull Town town) {
return -1;
}

Long lastRaidTime = war.getLastRaidTime();
long lastRaidTime = war.getLastRaidTime();
//6 hour raid cooldown for war
if ((System.currentTimeMillis() / 1000) - lastRaidTime <= 21600) {
return 0;
Expand Down

0 comments on commit 16add93

Please sign in to comment.