Added bypass for repair command

This commit is contained in:
stijnb1234 2020-02-26 10:50:15 +01:00
parent cb78772f85
commit be11d3852a

View file

@ -448,6 +448,7 @@ public class V10LiftCommand implements CommandExecutor {
if (sender instanceof Player) {
Player p = (Player) sender;
if (!p.hasPermission("v10lift.admin")) {
int masterAmount = V10LiftPlugin.getSConfig().getFile().getInt("MasterRepairAmount");
Optional<XMaterial> mat = XMaterial.matchXMaterial(Objects.requireNonNull(V10LiftPlugin.getSConfig().getFile().getString("MasterRepairItem"), "MasterRepairItem is null"));
if (!mat.isPresent()) {
@ -467,6 +468,7 @@ public class V10LiftCommand implements CommandExecutor {
p.getInventory().remove(new ItemStack(masterItem, masterAmount));
}
}
}
V10LiftPlugin.getAPI().setDefective(liftName, false);
sender.sendMessage(ChatColor.GREEN + "Lift repaired!");
return true;