mirror of
https://github.com/songoda/UltimateRepairing.git
synced 2024-11-29 14:06:30 +01:00
made it will kick you out from a repair before your in the interface.
This commit is contained in:
parent
a518bfaf82
commit
7b55784e08
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user