From 39e6917ae8a1c24a55fe832c7510b14f2d1e9d69 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 29 Feb 2024 21:49:13 -0600 Subject: [PATCH] hard set mine windows --- src/engine/objects/Mine.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index ec78bb26..d24c7401 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -62,6 +62,8 @@ public class Mine extends AbstractGameObject { public int liveTime; + public int liveLength = 3600; + public static ArrayList ChinaMines = new ArrayList<>(); public static ArrayList EuroMines = new ArrayList<>(); public static ArrayList AmericaMines = new ArrayList<>(); @@ -278,7 +280,7 @@ public class Mine extends AbstractGameObject { writer.putInt(mine.production.hash); writer.putInt(mine.getModifiedProductionAmount()); writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here - writer.putInt(3600); //window in seconds + writer.putInt(mine.liveLength); //window in seconds // Errant mines are currently open. Set time to now. @@ -299,7 +301,11 @@ public class Mine extends AbstractGameObject { mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).withNano(0); writer.putLocalDateTime(mineOpenTime); - writer.putLocalDateTime(mineOpenTime.plusHours(1)); + if(mine.liveLength == 3600) { + writer.putLocalDateTime(mineOpenTime.plusHours(1)); + } else{ + writer.putLocalDateTime(mineOpenTime.plusMinutes(30)); + } writer.put(mine.isActive ? (byte) 0x01 : (byte) 0x00); Building mineTower = BuildingManager.getBuilding(mine.buildingID);