1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00

Merge pull request #1294 from gecko10000/master

Make cave vines collection work with bottom-most plant as well
This commit is contained in:
Zrips 2021-10-26 14:11:59 +03:00 committed by GitHub
commit 9c90e53839
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1643,13 +1643,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);