mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-01-21 07:05:05 +01:00
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:
@@ -535,6 +535,10 @@ public class HerbalismManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAgeableMature(Ageable ageable) {
|
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()
|
return ageable.getAge() == ageable.getMaximumAge()
|
||||||
&& ageable.getAge() != 0;
|
&& ageable.getAge() != 0;
|
||||||
}
|
}
|
||||||
@@ -868,6 +872,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
case "beetroots" -> replantMaterial = Material.matchMaterial("BEETROOT_SEEDS");
|
case "beetroots" -> replantMaterial = Material.matchMaterial("BEETROOT_SEEDS");
|
||||||
case "cocoa" -> replantMaterial = Material.matchMaterial("COCOA_BEANS");
|
case "cocoa" -> replantMaterial = Material.matchMaterial("COCOA_BEANS");
|
||||||
case "torchflower" -> replantMaterial = Material.matchMaterial("TORCHFLOWER_SEEDS");
|
case "torchflower" -> replantMaterial = Material.matchMaterial("TORCHFLOWER_SEEDS");
|
||||||
|
case "sweet_berry_bush" -> replantMaterial = Material.matchMaterial("SWEET_BERRIES");
|
||||||
default -> {
|
default -> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -956,6 +961,17 @@ public class HerbalismManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -484,6 +484,7 @@ Green_Thumb_Replanting_Crops:
|
|||||||
Potatoes: true
|
Potatoes: true
|
||||||
Beetroots: true
|
Beetroots: true
|
||||||
Cocoa: true
|
Cocoa: true
|
||||||
|
Sweet_Berry_Bush: true
|
||||||
#
|
#
|
||||||
# Settings for Double Drops
|
# Settings for Double Drops
|
||||||
###
|
###
|
||||||
|
|||||||
Reference in New Issue
Block a user