Browse Source

30 minute mine windows

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
1cb0848690
  1. 12
      src/engine/objects/Mine.java
  2. 8
      src/engine/workthreads/HourlyJobThread.java

12
src/engine/objects/Mine.java

@ -316,8 +316,16 @@ public class Mine extends AbstractGameObject {
mineOpenTime = mineOpenTime.plusDays(1); mineOpenTime = mineOpenTime.plusDays(1);
mineCloseTime = mineCloseTime.plusDays(1); mineCloseTime = mineCloseTime.plusDays(1);
} }
writer.putLocalDateTime(mineOpenTime); String aMpMOPEN = "AM";
writer.putLocalDateTime(mineCloseTime); String aMpMCLOSE = "AM";
if(mineOpenTime.isAfter(LocalDateTime.now().withHour(11).withMinute(59))){
aMpMOPEN = "PM";
}
if(mineCloseTime.isAfter(LocalDateTime.now().withHour(11).withMinute(59))){
aMpMCLOSE = "PM";
}
writer.putString(mineOpenTime.getHour() + ":" + mineOpenTime.getMinute() + " " + aMpMOPEN);
writer.putString(mineCloseTime.getHour() + ":" + mineCloseTime.getMinute() + " " + aMpMCLOSE);
writer.put(mine.isActive ? (byte) 0x01 : (byte) 0x00); writer.put(mine.isActive ? (byte) 0x01 : (byte) 0x00);
Building mineTower = BuildingManager.getBuilding(mine.buildingID); Building mineTower = BuildingManager.getBuilding(mine.buildingID);

8
src/engine/workthreads/HourlyJobThread.java

@ -96,11 +96,15 @@ public class HourlyJobThread implements Runnable {
if (mine.liveTime == LocalDateTime.now().getHour() && mine.wasClaimed == false) { if (mine.liveTime == LocalDateTime.now().getHour() && mine.wasClaimed == false) {
if(mine.firstThirty == true && LocalDateTime.now().isAfter(LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0)) && LocalDateTime.now().isBefore(LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0))){ if(mine.firstThirty == true && LocalDateTime.now().isAfter(LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0)) && LocalDateTime.now().isBefore(LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0))){
mineWindowOpen(mine); if(mine.isActive == false) {
mineWindowOpen(mine);
}
continue; continue;
} }
if(mine.firstThirty == false && LocalDateTime.now().isAfter(LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0)) && LocalDateTime.now().isBefore(LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).plusHours(1))){ if(mine.firstThirty == false && LocalDateTime.now().isAfter(LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0)) && LocalDateTime.now().isBefore(LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).plusHours(1))){
mineWindowOpen(mine); if(mine.isActive == false) {
mineWindowOpen(mine);
}
continue; continue;
} }

Loading…
Cancel
Save