Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55fea8a20b | ||
|
|
19c6baf927 | ||
|
|
4130a767dc |
@@ -18,8 +18,9 @@ import engine.net.client.Protocol;
|
|||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Guild;
|
import engine.objects.Guild;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import org.joda.time.DateTime;
|
import java.time.Instant;
|
||||||
import org.joda.time.Seconds;
|
import java.time.Duration;
|
||||||
|
import java.time.temporal.ChronoField;
|
||||||
|
|
||||||
public class ArcMineWindowAvailableTimeMsg extends ClientNetMsg {
|
public class ArcMineWindowAvailableTimeMsg extends ClientNetMsg {
|
||||||
|
|
||||||
@@ -27,8 +28,8 @@ public class ArcMineWindowAvailableTimeMsg extends ClientNetMsg {
|
|||||||
private Building treeOfLife;
|
private Building treeOfLife;
|
||||||
|
|
||||||
private int currentMineHour;
|
private int currentMineHour;
|
||||||
private Seconds secondsLeft;
|
private Duration secondsLeft;
|
||||||
private DateTime lateTime;
|
private Instant lateTime;
|
||||||
private int late;
|
private int late;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,15 +74,15 @@ public class ArcMineWindowAvailableTimeMsg extends ClientNetMsg {
|
|||||||
currentMineHour = guild.getMineTime();
|
currentMineHour = guild.getMineTime();
|
||||||
|
|
||||||
late = MBServerStatics.MINE_LATE_WINDOW;
|
late = MBServerStatics.MINE_LATE_WINDOW;
|
||||||
lateTime = DateTime.now();
|
lateTime = Instant.now();
|
||||||
|
|
||||||
if (late == 0)
|
if (late == 0)
|
||||||
lateTime = lateTime.plusDays(1);
|
lateTime = lateTime.plus(Duration.ofDays(1));
|
||||||
|
|
||||||
lateTime = lateTime.hourOfDay().setCopy(late);
|
lateTime = lateTime.with(ChronoField.HOUR_OF_DAY, late);
|
||||||
|
|
||||||
late = ((late > 23) ? (late - 24) : late);
|
late = ((late > 23) ? (late - 24) : late);
|
||||||
secondsLeft = Seconds.secondsBetween(DateTime.now(), lateTime);
|
secondsLeft = Duration.between(Instant.now(), lateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,4 +108,4 @@ public class ArcMineWindowAvailableTimeMsg extends ClientNetMsg {
|
|||||||
public void setBuildingUUID(int buildingUUID) {
|
public void setBuildingUUID(int buildingUUID) {
|
||||||
this.buildingUUID = buildingUUID;
|
this.buildingUUID = buildingUUID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user