Browse Source

mines close on time

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
66fbbada48
  1. 4
      src/engine/workthreads/MineThread.java

4
src/engine/workthreads/MineThread.java

@ -22,7 +22,7 @@ public class MineThread implements Runnable {
} }
@Override @Override
public void run() { public void run() {
LocalDateTime nextPulse = LocalDateTime.now().withMinute(0).withSecond(0); LocalDateTime nextPulse = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0);
while (true){ while (true){
if(LocalDateTime.now().isAfter(nextPulse)) { if(LocalDateTime.now().isAfter(nextPulse)) {
for (Mine mine : Mine.getMines()) { for (Mine mine : Mine.getMines()) {
@ -42,7 +42,7 @@ public class MineThread implements Runnable {
minute = 30; minute = 30;
LocalDateTime openTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(minute).withSecond(0); LocalDateTime openTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(minute).withSecond(0);
LocalDateTime closeTime = openTime.plusMinutes(30); LocalDateTime closeTime = openTime.plusMinutes(29);
//current time is after start time and before close time, open mine window //current time is after start time and before close time, open mine window
if (LocalDateTime.now().isAfter(openTime.minusMinutes(1)) && !mine.wasClaimed && !mine.wasOpened) { if (LocalDateTime.now().isAfter(openTime.minusMinutes(1)) && !mine.wasClaimed && !mine.wasOpened) {

Loading…
Cancel
Save