Added permission node to bypass Arcane Repair and keep enchantments

This commit is contained in:
nossr50 2012-03-08 18:58:50 -08:00
parent 0441b062bd
commit 74b7aa5340
4 changed files with 8 additions and 2 deletions

View File

@ -12,6 +12,7 @@ Version 2.0.00-dev
+ Added ability to summon Ocelots with Call of the Wild + Added ability to summon Ocelots with Call of the Wild
+ Added offline user functionality to mmoedit + Added offline user functionality to mmoedit
+ Added bookshelves to list of blocks that don't trigger abilities. + 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 ClassCastException from Taming preventDamage checks
= Fixed issue with Blast Mining not seeing TNT for detonation due to snow = Fixed issue with Blast Mining not seeing TNT for detonation due to snow
= Fixed issue with block interaction returning NPEs = Fixed issue with block interaction returning NPEs

View File

@ -125,6 +125,10 @@ public class mcPermissions {
return player.hasPermission("mcmmo.skills.repair"); return player.hasPermission("mcmmo.skills.repair");
} }
public boolean repairArcaneBypass(Player player) {
return player.hasPermission(("mcmmo.skills.repair.arcanebypass"));
}
public boolean unarmed(Player player) { public boolean unarmed(Player player) {
return player.hasPermission("mcmmo.skills.unarmed"); return player.hasPermission("mcmmo.skills.unarmed");
} }

View File

@ -240,7 +240,6 @@ public class Repair {
player.sendMessage(mcLocale.getString("Repair.Downgraded")); player.sendMessage(mcLocale.getString("Repair.Downgraded"));
else else
player.sendMessage(mcLocale.getString("Repair.ArcanePerfect")); player.sendMessage(mcLocale.getString("Repair.ArcanePerfect"));
} }
/** /**
@ -532,7 +531,7 @@ public class Repair {
public static void repairItem(Player player, ItemStack is) public static void repairItem(Player player, ItemStack is)
{ {
//Handle the enchantments //Handle the enchantments
if(LoadProperties.mayLoseEnchants) if(LoadProperties.mayLoseEnchants && !mcPermissions.getInstance().repairArcaneBypass(player))
addEnchants(player, is); addEnchants(player, is);
is.setDurability(getRepairAmount(is, player)); is.setDurability(getRepairAmount(is, player));
} }

View File

@ -210,6 +210,8 @@ permissions:
description: Allows access to the Woodcutting skill description: Allows access to the Woodcutting skill
mcmmo.skills.repair: mcmmo.skills.repair:
description: Allows access to the Repair skill 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: mcmmo.skills.unarmed:
description: Allows access to the Unarmed skill description: Allows access to the Unarmed skill
mcmmo.skills.archery: mcmmo.skills.archery: