From 363461647532cc38a1cf8cf645707061d9ea3ee7 Mon Sep 17 00:00:00 2001 From: Syndromeramo <21965004-syndromeramo@users.noreply.gitlab.com> Date: Tue, 15 Jul 2025 12:41:03 +0000 Subject: [PATCH] Willow branches now properly regrow every 5 minutes --- Server/src/main/content/global/skill/farming/Patch.kt | 4 ++++ .../main/content/global/skill/farming/timers/CropGrowth.kt | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/global/skill/farming/Patch.kt b/Server/src/main/content/global/skill/farming/Patch.kt index b150b0590..4fde65b5e 100644 --- a/Server/src/main/content/global/skill/farming/Patch.kt +++ b/Server/src/main/content/global/skill/farming/Patch.kt @@ -426,6 +426,10 @@ class Patch(val player: Player, val patch: FarmingPatch, var plantable: Plantabl // restocking their fruit should take 40 minutes per fruit minutes = 40 } + else if(plantable == Plantable.WILLOW_SAPLING && isGrown()) { + // Willow Branches grow back in only 5 minutes + minutes = 5 + } return minutes } diff --git a/Server/src/main/content/global/skill/farming/timers/CropGrowth.kt b/Server/src/main/content/global/skill/farming/timers/CropGrowth.kt index 46dbfc61f..3cc14cd55 100644 --- a/Server/src/main/content/global/skill/farming/timers/CropGrowth.kt +++ b/Server/src/main/content/global/skill/farming/timers/CropGrowth.kt @@ -57,7 +57,7 @@ class CropGrowth : PersistTimer (500, "farming:crops", isSoft = true) { private fun runOfflineCatchupLogic() { for ((_, patch) in patchMap) { val type = patch.patch.type - val shouldPlayCatchup = !patch.isGrown() || (type == PatchType.BUSH_PATCH && patch.getFruitOrBerryCount() < 4) || (type == PatchType.FRUIT_TREE_PATCH && patch.getFruitOrBerryCount() < 6) + val shouldPlayCatchup = !patch.isGrown() || (type == PatchType.BUSH_PATCH && patch.getFruitOrBerryCount() < 4) || (type == PatchType.FRUIT_TREE_PATCH && patch.getFruitOrBerryCount() < 6) || (patch.plantable == Plantable.WILLOW_SAPLING && patch.harvestAmt < 6) if (shouldPlayCatchup && !patch.isDead && !patch.isChoppedFruitTree()) { var stagesToSimulate = if (!patch.isGrown()) { if (patch.isWeedy() || patch.isEmptyAndWeeded()) patch.currentGrowthStage % 4 @@ -69,6 +69,8 @@ class CropGrowth : PersistTimer (500, "farming:crops", isSoft = true) { stagesToSimulate += Math.min(4, 4 - patch.getFruitOrBerryCount()) if (type == PatchType.FRUIT_TREE_PATCH) stagesToSimulate += Math.min(6, 6 - patch.getFruitOrBerryCount()) + if (patch.plantable == Plantable.WILLOW_SAPLING) + stagesToSimulate += Math.min(6, 6 - patch.harvestAmt) } val nowTime = System.currentTimeMillis()