mirror of
https://github.com/songoda/UltimateRepairing.git
synced 2025-02-27 09:51:26 +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) {
|
public void preRepair(Player p, RepairType type, Location loc) {
|
||||||
try {
|
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());
|
Item i = p.getWorld().dropItem(loc.add(0.5, 2, 0.5), p.getItemInHand());
|
||||||
|
|
||||||
// Support for EpicHoppers suction.
|
// Support for EpicHoppers suction.
|
||||||
@ -169,6 +156,20 @@ public class RepairHandler {
|
|||||||
if (p.hasPermission("ultimaterepairing.use.ITEM"))
|
if (p.hasPermission("ultimaterepairing.use.ITEM"))
|
||||||
num++;
|
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.*")) {
|
if (num >= 2 || p.hasPermission("ultimaterepairing.use.*")) {
|
||||||
repairType(p);
|
repairType(p);
|
||||||
getDataFor(p).setLocation(location);
|
getDataFor(p).setLocation(location);
|
||||||
|
Loading…
Reference in New Issue
Block a user