Browse Source

30 minute mine windows

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
60a7b395e5
  1. 12
      src/engine/objects/Mine.java
  2. 11
      src/engine/server/world/WorldServer.java

12
src/engine/objects/Mine.java

@ -311,13 +311,13 @@ public class Mine extends AbstractGameObject {
mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0).withNano(0); mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0).withNano(0);
} }
if(LocalDateTime.now().isAfter(mineOpenTime.plusMinutes(30))){ LocalDateTime mineCloseTime = mineOpenTime.plusMinutes(30);
writer.putLocalDateTime(mineOpenTime.plusDays(1)); if(LocalDateTime.now().isAfter(mineCloseTime)){
writer.putLocalDateTime(mineOpenTime.plusMinutes(30).plusDays(1)); mineOpenTime = mineOpenTime.plusDays(1);
} else { mineCloseTime = mineCloseTime.plusDays(1);
writer.putLocalDateTime(mineOpenTime);
writer.putLocalDateTime(mineOpenTime.plusMinutes(30));
} }
writer.putLocalDateTime(mineOpenTime);
writer.putLocalDateTime(mineCloseTime);
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);

11
src/engine/server/world/WorldServer.java

@ -230,11 +230,12 @@ public class WorldServer {
Thread hourlyJobThread = new Thread(new HourlyJobThread()); Thread hourlyJobThread = new Thread(new HourlyJobThread());
hourlyJobThread.setName("hourlyJob"); hourlyJobThread.setName("hourlyJob");
hourlyJobThread.start(); hourlyJobThread.start();
if(LocalDateTime.now().isAfter(LocalDateTime.now().withMinute(30).withSecond(0))) { //if(LocalDateTime.now().isAfter(LocalDateTime.now().withMinute(30).withSecond(0))) {
nextHourlyJobTime = LocalDateTime.now().withMinute(0).withSecond(1).plusHours(1); // nextHourlyJobTime = LocalDateTime.now().withMinute(0).withSecond(0).plusHours(1);
}else{ //}else{
nextHourlyJobTime = LocalDateTime.now().withMinute(30).withSecond(1); // nextHourlyJobTime = LocalDateTime.now().withMinute(30).withSecond(0);
} //}
nextHourlyJobTime = LocalDateTime.now().plusMinutes(1);
} }
if (LocalDateTime.now().isAfter(nextWareHousePushTime)) { if (LocalDateTime.now().isAfter(nextWareHousePushTime)) {

Loading…
Cancel
Save