From 6f1d348a1625f0cc48f38d1c7a9ec1697ab16bec Mon Sep 17 00:00:00 2001 From: FireML <106587317+FireML@users.noreply.github.com> Date: Wed, 17 May 2023 12:20:52 +0100 Subject: [PATCH] Improve Berry Checks Allow payment when holding bonemeal by checking the plant's age. --- .../com/gamingmesh/jobs/listeners/JobsPaymentListener.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 7e5b3aa0..24e7c9d1 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -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()) {