From 642b1bc176f39952a72960afafa60c12a4acf29b Mon Sep 17 00:00:00 2001 From: Zrips Date: Fri, 14 Jun 2019 16:52:51 +0300 Subject: [PATCH] And lets include blast furnace to furnace and smoker group --- .../jobs/listeners/JobsPaymentListener.java | 14 +++++++++----- .../jobs/stuff/FurnaceBrewingHandling.java | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 8a4b4a93..ed8c63b7 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -398,9 +398,11 @@ public class JobsPaymentListener implements Listener { CMIMaterial cmat = CMIMaterial.get(block); if (cmat.equals(CMIMaterial.FURNACE) && block.hasMetadata(furnaceOwnerMetadata)) FurnaceBrewingHandling.removeFurnace(block); - if (cmat.equals(CMIMaterial.SMOKER) && block.hasMetadata(furnaceOwnerMetadata)) + else if (cmat.equals(CMIMaterial.SMOKER) && block.hasMetadata(furnaceOwnerMetadata)) FurnaceBrewingHandling.removeFurnace(block); - if (cmat.equals(CMIMaterial.BREWING_STAND) && block.hasMetadata(brewingOwnerMetadata)) + else if (cmat.equals(CMIMaterial.BLAST_FURNACE) && block.hasMetadata(furnaceOwnerMetadata)) + FurnaceBrewingHandling.removeFurnace(block); + else if (cmat.equals(CMIMaterial.BREWING_STAND) && block.hasMetadata(brewingOwnerMetadata)) FurnaceBrewingHandling.removeBrewing(block); if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName())) @@ -1558,10 +1560,12 @@ public class JobsPaymentListener implements Listener { if (cmat.equals(CMIMaterial.FURNACE) && block.hasMetadata(furnaceOwnerMetadata)) FurnaceBrewingHandling.removeFurnace(block); - if (cmat.equals(CMIMaterial.SMOKER) && block.hasMetadata(furnaceOwnerMetadata)) + else if (cmat.equals(CMIMaterial.SMOKER) && block.hasMetadata(furnaceOwnerMetadata)) + FurnaceBrewingHandling.removeFurnace(block); + else if (cmat.equals(CMIMaterial.BLAST_FURNACE) && block.hasMetadata(furnaceOwnerMetadata)) FurnaceBrewingHandling.removeFurnace(block); - if (cmat.equals(CMIMaterial.BREWING_STAND) && block.hasMetadata(brewingOwnerMetadata)) + else if (cmat.equals(CMIMaterial.BREWING_STAND) && block.hasMetadata(brewingOwnerMetadata)) FurnaceBrewingHandling.removeBrewing(block); if (Jobs.getGCManager().useBlockProtection) @@ -1585,7 +1589,7 @@ public class JobsPaymentListener implements Listener { if (block == null) return; CMIMaterial cmat = CMIMaterial.get(block); - if (cmat.equals(CMIMaterial.FURNACE) || cmat.equals(CMIMaterial.LEGACY_BURNING_FURNACE) || cmat.equals(CMIMaterial.SMOKER)) { + if (cmat.equals(CMIMaterial.FURNACE) || cmat.equals(CMIMaterial.LEGACY_BURNING_FURNACE) || cmat.equals(CMIMaterial.SMOKER) || cmat.equals(CMIMaterial.BLAST_FURNACE)) { if (!Jobs.getGCManager().isFurnacesReassign()) return; diff --git a/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java b/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java index 2e0d220f..18daef56 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java @@ -241,7 +241,7 @@ public class FurnaceBrewingHandling { public static ownershipFeedback registerFurnaces(Player player, Block block) { CMIMaterial cmat = CMIMaterial.get(block); - if (!cmat.equals(CMIMaterial.FURNACE) && !cmat.equals(CMIMaterial.LEGACY_BURNING_FURNACE) && !cmat.equals(CMIMaterial.SMOKER)) + if (!cmat.equals(CMIMaterial.FURNACE) && !cmat.equals(CMIMaterial.LEGACY_BURNING_FURNACE) && !cmat.equals(CMIMaterial.SMOKER) && !cmat.equals(CMIMaterial.BLAST_FURNACE)) return ownershipFeedback.invalid; JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player); @@ -337,7 +337,7 @@ public class FurnaceBrewingHandling { if (block == null) continue; CMIMaterial cmat = CMIMaterial.get(block); - if (!cmat.equals(CMIMaterial.FURNACE) && !cmat.equals(CMIMaterial.LEGACY_BURNING_FURNACE) && !cmat.equals(CMIMaterial.SMOKER)) + if (!cmat.equals(CMIMaterial.FURNACE) && !cmat.equals(CMIMaterial.LEGACY_BURNING_FURNACE) && !cmat.equals(CMIMaterial.SMOKER) && !cmat.equals(CMIMaterial.BLAST_FURNACE)) continue; block.removeMetadata(JobsPaymentListener.furnaceOwnerMetadata, Jobs.getInstance()); }