Add support for sweet berry bush harvesting and replanting (#5238)

* Add support for sweet berry bush harvesting and replanting

* Accidentally left my test code for torchflower replanting.
This commit is contained in:
Dominykas
2026-01-17 22:51:39 +02:00
committed by GitHub
parent 8b7cffbe49
commit 4a890a28a1
2 changed files with 17 additions and 0 deletions

View File

@@ -535,6 +535,10 @@ public class HerbalismManager extends SkillManager {
}
public boolean isAgeableMature(Ageable ageable) {
// Sweet berry bush is harvestable at age 2 and 3 (max is 3)
if (ageable.getMaterial() == Material.SWEET_BERRY_BUSH) {
return ageable.getAge() >= 2;
}
return ageable.getAge() == ageable.getMaximumAge()
&& ageable.getAge() != 0;
}
@@ -868,6 +872,7 @@ public class HerbalismManager extends SkillManager {
case "beetroots" -> replantMaterial = Material.matchMaterial("BEETROOT_SEEDS");
case "cocoa" -> replantMaterial = Material.matchMaterial("COCOA_BEANS");
case "torchflower" -> replantMaterial = Material.matchMaterial("TORCHFLOWER_SEEDS");
case "sweet_berry_bush" -> replantMaterial = Material.matchMaterial("SWEET_BERRIES");
default -> {
return false;
}
@@ -956,6 +961,17 @@ public class HerbalismManager extends SkillManager {
}
break;
case "sweet_berry_bush":
// Sweet berry bush has ages 0-3, where 2+ has berries
// Cap at age 1 to prevent instant re-harvest exploit with enough herbalism levels
if (greenTerra || greenThumbStage >= 2) {
finalAge = 1;
} else {
finalAge = 0;
}
break;
default:
return false;
}

View File

@@ -484,6 +484,7 @@ Green_Thumb_Replanting_Crops:
Potatoes: true
Beetroots: true
Cocoa: true
Sweet_Berry_Bush: true
#
# Settings for Double Drops
###