1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-20 14:21:43 +01:00

Merge pull request #1601 from FireML/improve-berry-checks

Improve Berry Checks
This commit is contained in:
Zrips 2023-05-19 13:13:20 +03:00 committed by GitHub
commit a9eaca90dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1750,12 +1750,15 @@ public final class JobsPaymentListener implements Listener {
if (level.getLevel() == level.getMaximumLevel()) {
Jobs.action(jPlayer, new BlockCollectInfo(CMIMaterial.BONE_MEAL, ActionType.COLLECT), block);
}
} else if ((cmat == CMIMaterial.SWEET_BERRY_BUSH || cmat == CMIMaterial.CAVE_VINES_PLANT || cmat == CMIMaterial.CAVE_VINES) && hand != CMIMaterial.BONE_MEAL.getMaterial()) {
} else if ((cmat == CMIMaterial.SWEET_BERRY_BUSH || cmat == CMIMaterial.CAVE_VINES_PLANT || cmat == CMIMaterial.CAVE_VINES)) {
if (cmat == CMIMaterial.SWEET_BERRY_BUSH) {
Ageable age = (Ageable) block.getBlockData();
if (age.getAge() >= 2)
if (age.getAge() == 2 && hand != CMIMaterial.BONE_MEAL.getMaterial()) {
Jobs.action(jPlayer, new BlockCollectInfo(CMIMaterial.SWEET_BERRIES, ActionType.COLLECT, age.getAge()), block);
} else if (age.getAge() == 3) {
Jobs.action(jPlayer, new BlockCollectInfo(CMIMaterial.SWEET_BERRIES, ActionType.COLLECT, age.getAge()), block);
}
} else {
org.bukkit.block.data.type.CaveVinesPlant caveVines = (org.bukkit.block.data.type.CaveVinesPlant) block.getBlockData();
if (caveVines.isBerries()) {