From 3cc8183ccba9e194af6822ce833b1f66c66d2abf Mon Sep 17 00:00:00 2001 From: Zrips Date: Mon, 7 Mar 2022 17:51:03 +0200 Subject: [PATCH] WEEPING_VINES to pay out for entire broken stack --- .../gamingmesh/jobs/config/GeneralConfigManager.java | 2 +- .../gamingmesh/jobs/listeners/JobsPaymentListener.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java index e68e21ba..3bfa2626 100644 --- a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java @@ -481,7 +481,7 @@ public class GeneralConfigManager { "This option is only related to: sugar_cane, cactus, kelp, bamboo"); preventCropResizePayment = c.get("prevent-crop-resize-payment", false);*/ - c.addComment("pay-for-above", "When enabled we will try to pay player for blocks above broken ones. This only applies to sugarcane, bamboo and kelp"); + c.addComment("pay-for-above", "When enabled we will try to pay player for blocks above broken ones. This only applies to sugarcane, bamboo, kelp and weeping_vines"); payForAbove = c.get("pay-for-above", false); c.addComment("pay-for-stacked-entities", "Allows to pay for stacked entities for each one. Requires StackMob or WildStacker."); diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 6bc2ddfb..e8f592e7 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -1883,7 +1883,8 @@ public final class JobsPaymentListener implements Listener { CMIMaterial mat = CMIMaterial.get(block); - if (!mat.equals(CMIMaterial.SUGAR_CANE) && !mat.equals(CMIMaterial.BAMBOO) && !mat.equals(CMIMaterial.KELP_PLANT)) + if (!mat.equals(CMIMaterial.SUGAR_CANE) && !mat.equals(CMIMaterial.BAMBOO) && !mat.equals(CMIMaterial.KELP_PLANT) && !mat.equals(CMIMaterial.WEEPING_VINES) && !mat.equals( + CMIMaterial.WEEPING_VINES_PLANT)) return; if (!Jobs.getGCManager().canPerformActionInWorld(block.getWorld())) @@ -1892,7 +1893,12 @@ public final class JobsPaymentListener implements Listener { if (event.getSourceBlock().equals(event.getBlock())) return; - if (event.getBlock().getLocation().getBlockY() <= event.getSourceBlock().getLocation().getBlockY()) + if ((mat.equals(CMIMaterial.SUGAR_CANE) || mat.equals(CMIMaterial.BAMBOO) || mat.equals(CMIMaterial.KELP_PLANT)) && + event.getBlock().getLocation().getBlockY() <= event.getSourceBlock().getLocation().getBlockY()) + return; + + if ((mat.equals(CMIMaterial.WEEPING_VINES) || mat.equals(CMIMaterial.WEEPING_VINES_PLANT)) && + event.getBlock().getLocation().getBlockY() >= event.getSourceBlock().getLocation().getBlockY()) return; Location loc = event.getSourceBlock().getLocation().clone();