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

Make cave vines collection work with bottom-most plant as well

This commit is contained in:
lteytelm 2021-10-10 14:30:45 -07:00
parent 52547b94a5
commit ae1cd87c10

View File

@ -1639,13 +1639,13 @@ 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) && hand != CMIMaterial.BONE_MEAL.getMaterial()) {
} else if ((cmat == CMIMaterial.SWEET_BERRY_BUSH || cmat == CMIMaterial.CAVE_VINES_PLANT || cmat == CMIMaterial.CAVE_VINES) && hand != CMIMaterial.BONE_MEAL.getMaterial()) {
if (cmat == CMIMaterial.SWEET_BERRY_BUSH) {
Ageable age = (Ageable) block.getBlockData();
if (age.getAge() >= 2)
Jobs.action(jPlayer, new BlockCollectInfo(CMIMaterial.SWEET_BERRIES, ActionType.COLLECT, age.getAge()), block);
} else if (cmat == CMIMaterial.CAVE_VINES_PLANT) {
} else {
org.bukkit.block.data.type.CaveVinesPlant caveVines = (org.bukkit.block.data.type.CaveVinesPlant) block.getBlockData();
if (caveVines.isBerries()) {
Jobs.action(jPlayer, new BlockCollectInfo(CMIMaterial.GLOW_BERRIES, ActionType.COLLECT), block);