From 34cb94359528508e187b090b19631017a3c9b215 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 23 Feb 2024 20:07:20 -0600 Subject: [PATCH] Revert "randomized mine times" This reverts commit de3f1cf004893450b665dee148405d7f4bf005b3. --- src/engine/objects/Mine.java | 29 --------------------- src/engine/workthreads/HourlyJobThread.java | 4 +-- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 5d32b497..baacb51f 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -15,7 +15,6 @@ import engine.gameManager.*; import engine.net.ByteBufferWriter; import engine.net.client.msg.ErrorPopupMsg; import engine.server.MBServerStatics; -import org.joda.time.DateTime; import org.pmw.tinylog.Logger; import java.net.UnknownHostException; @@ -58,8 +57,6 @@ public class Mine extends AbstractGameObject { public Integer totalPlayers; public boolean hasProduced = false; - - public int mineTime; /** * ResultSet Constructor */ @@ -113,34 +110,8 @@ public class Mine extends AbstractGameObject { Building mineTower = BuildingManager.getBuilding(this.buildingID); mineTower.setMaxHitPoints(5000 * this.capSize); mineTower.setCurrentHitPoints((float)5000 * this.capSize); - this.mineTime = ThreadLocalRandom.current().nextInt(1-23); - refactorMineTime(this); } - - public static void refactorMineTime(Mine mine){ - if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("sunday")){ - mine.mineTime += 1; - } - if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("monday")){ - mine.mineTime += 2; - } - if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("tuesday")){ - mine.mineTime += 3; - } - if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("wednesday")){ - mine.mineTime += 4; - } - if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("thursday")){ - mine.mineTime += 5; - } - if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("friday")){ - mine.mineTime += 6; - } - if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("saturday")){ - mine.mineTime += 7; - } - } public static void releaseMineClaims(PlayerCharacter playerCharacter) { if (playerCharacter == null) diff --git a/src/engine/workthreads/HourlyJobThread.java b/src/engine/workthreads/HourlyJobThread.java index e756e07a..4dc8866b 100644 --- a/src/engine/workthreads/HourlyJobThread.java +++ b/src/engine/workthreads/HourlyJobThread.java @@ -95,8 +95,8 @@ public class HourlyJobThread implements Runnable { // Open Mines owned by nations having their WOO // set to the current mine window. - //if (mine.getOwningGuild().getNation().getMineTime() == LocalDateTime.now().getHour() && mine.wasClaimed == false) { - if(mine.mineTime == LocalDateTime.now().getHour() && mine.wasClaimed == false) { + if (mine.getOwningGuild().getNation().getMineTime() == + LocalDateTime.now().getHour() && mine.wasClaimed == false) { HourlyJobThread.mineWindowOpen(mine); continue; }