From 7b55784e085e379020515e025df8c9be66465d79 Mon Sep 17 00:00:00 2001 From: Brianna O'Keefe Date: Sun, 25 Nov 2018 18:12:07 -0500 Subject: [PATCH] made it will kick you out from a repair before your in the interface. --- .../handlers/RepairHandler.java | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/songoda/ultimaterepairing/handlers/RepairHandler.java b/src/main/java/com/songoda/ultimaterepairing/handlers/RepairHandler.java index def0064..cb3f8e3 100644 --- a/src/main/java/com/songoda/ultimaterepairing/handlers/RepairHandler.java +++ b/src/main/java/com/songoda/ultimaterepairing/handlers/RepairHandler.java @@ -110,19 +110,6 @@ public class RepairHandler { public void preRepair(Player p, RepairType type, Location loc) { try { - if (loc.add(0, 1, 0).getBlock().getType() != Material.AIR) { - p.sendMessage(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.needspace")); - return; - } - if (p.getItemInHand().getDurability() <= 0) { - p.sendMessage(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.notdamaged")); - return; - } - if (p.getItemInHand().getMaxStackSize() != 1) { - p.sendMessage(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.cantrepair")); - return; - } - Item i = p.getWorld().dropItem(loc.add(0.5, 2, 0.5), p.getItemInHand()); // Support for EpicHoppers suction. @@ -169,6 +156,20 @@ public class RepairHandler { if (p.hasPermission("ultimaterepairing.use.ITEM")) num++; + + if (location.add(0, 1, 0).getBlock().getType() != Material.AIR) { + p.sendMessage(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.needspace")); + return; + } + if (p.getItemInHand().getDurability() <= 0) { + p.sendMessage(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.notdamaged")); + return; + } + if (p.getItemInHand().getMaxStackSize() != 1) { + p.sendMessage(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.cantrepair")); + return; + } + if (num >= 2 || p.hasPermission("ultimaterepairing.use.*")) { repairType(p); getDataFor(p).setLocation(location);