Browse Source

check if mines are active before spamming them to open

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
4734f23805
  1. 6
      src/engine/workthreads/MineThread.java

6
src/engine/workthreads/MineThread.java

@ -36,17 +36,17 @@ public class MineThread implements Runnable { @@ -36,17 +36,17 @@ public class MineThread implements Runnable {
LocalDateTime openTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(minute).withSecond(0);
LocalDateTime closeTime = openTime.plusMinutes(30);
if (now.isAfter(openTime)) {
if (now.isAfter(openTime) && !mine.isActive) {
mineWindowOpen(mine);
continue; // mine has not opened today yet, and it is now after the time it should have, open the mine
}
if(now.isAfter(closeTime) && BuildingManager.getBuilding(mine.getBuildingID()).getRank() == 1) {
if(now.isAfter(closeTime) && BuildingManager.getBuilding(mine.getBuildingID()).getRank() == 1 && mine.isActive) {
mineWindowClose(mine);
continue; // mine was never knocked down, close it
}
if(now.isAfter(closeTime) && mine.lastClaimer == null){
if(now.isAfter(closeTime) && mine.lastClaimer == null && mine.isActive){
if(mine.firstThirty){
mine.firstThirty = false;
}else{

Loading…
Cancel
Save