From 74b7aa5340ebea31761cb7c0993f9ccf1904eaf5 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 8 Mar 2012 18:58:50 -0800 Subject: [PATCH] Added permission node to bypass Arcane Repair and keep enchantments --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/mcPermissions.java | 4 ++++ src/main/java/com/gmail/nossr50/skills/Repair.java | 3 +-- src/main/resources/plugin.yml | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 14ac51856..f7666a636 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -12,6 +12,7 @@ Version 2.0.00-dev + Added ability to summon Ocelots with Call of the Wild + Added offline user functionality to mmoedit + Added bookshelves to list of blocks that don't trigger abilities. + + Added 'mcmmo.skills.repair.arcanebypass' permission node to bypass Arcane Repair and keep your enchantments = Fixed ClassCastException from Taming preventDamage checks = Fixed issue with Blast Mining not seeing TNT for detonation due to snow = Fixed issue with block interaction returning NPEs diff --git a/src/main/java/com/gmail/nossr50/mcPermissions.java b/src/main/java/com/gmail/nossr50/mcPermissions.java index e4357800c..7cc36a610 100644 --- a/src/main/java/com/gmail/nossr50/mcPermissions.java +++ b/src/main/java/com/gmail/nossr50/mcPermissions.java @@ -124,6 +124,10 @@ public class mcPermissions { public boolean repair(Player player) { return player.hasPermission("mcmmo.skills.repair"); } + + public boolean repairArcaneBypass(Player player) { + return player.hasPermission(("mcmmo.skills.repair.arcanebypass")); + } public boolean unarmed(Player player) { return player.hasPermission("mcmmo.skills.unarmed"); diff --git a/src/main/java/com/gmail/nossr50/skills/Repair.java b/src/main/java/com/gmail/nossr50/skills/Repair.java index 3fc75330e..b7ae54462 100644 --- a/src/main/java/com/gmail/nossr50/skills/Repair.java +++ b/src/main/java/com/gmail/nossr50/skills/Repair.java @@ -240,7 +240,6 @@ public class Repair { player.sendMessage(mcLocale.getString("Repair.Downgraded")); else player.sendMessage(mcLocale.getString("Repair.ArcanePerfect")); - } /** @@ -532,7 +531,7 @@ public class Repair { public static void repairItem(Player player, ItemStack is) { //Handle the enchantments - if(LoadProperties.mayLoseEnchants) + if(LoadProperties.mayLoseEnchants && !mcPermissions.getInstance().repairArcaneBypass(player)) addEnchants(player, is); is.setDurability(getRepairAmount(is, player)); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 9c00d6916..0aec027f2 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -210,6 +210,8 @@ permissions: description: Allows access to the Woodcutting skill mcmmo.skills.repair: description: Allows access to the Repair skill + mcmmo.skills.repair.arcanebypass: + description: Allows user to bypass Arcane Repair so he will never lose enchantments mcmmo.skills.unarmed: description: Allows access to the Unarmed skill mcmmo.skills.archery: