Added permissions nodes for repairing wood, bows, and leather.

This commit is contained in:
GJ 2012-04-03 12:34:33 -04:00
parent 2c4418e6e6
commit c8b30b6714
5 changed files with 27 additions and 4 deletions

View File

@ -88,7 +88,7 @@ public class LoadProperties extends ConfigLoader{
public static Boolean anvilmessages;
public static int rWood, rStone, rIron, rGold, rDiamond, rString, rLeather;
public static int anvilID;
public static int repairStoneLevel, repairIronLevel, repairGoldLevel, repairdiamondlevel;
public static int repairStoneLevel, repairIronLevel, repairGoldLevel, repairdiamondlevel, repairBowLevel;
/* Taming */
public static int mtameWolf, mtameOcelot;
@ -378,6 +378,7 @@ public class LoadProperties extends ConfigLoader{
repairIronLevel = config.getInt("Skills.Repair.Iron.Level_Required", 0);
repairGoldLevel = config.getInt("Skills.Repair.Gold.Level_Required", 0);
repairStoneLevel = config.getInt("Skills.Repair.Stone.Level_Required", 0);
repairBowLevel = config.getInt("Skills.Repair.String.Level_Required", 0);
tamingxpmodifier = config.getDouble("Experience.Formula.Multiplier.Taming", 1.0);
miningxpmodifier = config.getDouble("Experience.Formula.Multiplier.Mining", 1.0);

View File

@ -137,10 +137,18 @@ public class mcPermissions {
return player.hasPermission("mcmmo.ability.repair.arcaneforging");
}
public boolean woodRepair(Player player) {
return player.hasPermission("mcmmo.ability.repair.woodrepair");
}
public boolean stoneRepair(Player player) {
return player.hasPermission("mcmmo.ability.repair.stonerepair");
}
public boolean leatherRepair(Player player) {
return player.hasPermission("mcmmo.ability.repair.leatherrepair");
}
public boolean ironRepair(Player player) {
return player.hasPermission("mcmmo.ability.repair.ironrepair");
}
@ -161,6 +169,10 @@ public class mcPermissions {
return player.hasPermission("mcmmo.ability.repair.toolrepair");
}
public boolean bowRepair(Player player) {
return player.hasPermission("mcmmo.ability.repair.bowrepair");
}
/*
* MCMMO.ABILITY.UNARMED.*
*/

View File

@ -59,7 +59,7 @@ public class Repair {
repairItem(player, is, new ItemStack(LoadProperties.rGold));
xpHandler(player, PP, is, durabilityBefore, 4, true);
}
else if (ItemChecks.isLeatherArmor(is) && inventory.contains(LoadProperties.rLeather)) {
else if (ItemChecks.isLeatherArmor(is) && inventory.contains(LoadProperties.rLeather) && mcPermissions.getInstance().leatherRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rLeather));
xpHandler(player, PP, is, durabilityBefore, 1, true);
}
@ -76,7 +76,7 @@ public class Repair {
repairItem(player, is, new ItemStack(LoadProperties.rStone));
xpHandler(player, PP, is, durabilityBefore, 2, false);
}
else if (ItemChecks.isWoodTool(is) && inventory.contains(LoadProperties.rWood)) {
else if (ItemChecks.isWoodTool(is) && inventory.contains(LoadProperties.rWood) && mcPermissions.getInstance().woodRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rWood));
xpHandler(player, PP, is, durabilityBefore, 2, false);
}
@ -92,7 +92,7 @@ public class Repair {
repairItem(player, is, new ItemStack(LoadProperties.rGold));
xpHandler(player, PP, is, durabilityBefore, 8, true);
}
else if (is.getType().equals(Material.BOW) && inventory.contains(LoadProperties.rString)){
else if (is.getType().equals(Material.BOW) && inventory.contains(LoadProperties.rString) && skillLevel >= LoadProperties.repairBowLevel && mcPermissions.getInstance().bowRepair(player)){
repairItem(player, is, new ItemStack(LoadProperties.rString));
xpHandler(player, PP, is, durabilityBefore, 2, false);
}

View File

@ -162,6 +162,7 @@ Skills:
Leather:
ID: 334
String:
Level_Required: 0
ID: 287
Stone:
Level_Required: 0

View File

@ -211,18 +211,25 @@ permissions:
children:
mcmmo.ability.repair.repairbonus: true
mcmmo.ability.repair.arcaneforging: true
mcmmo.ability.repair.woodrepair: true
mcmmo.ability.repair.stonerepair: true
mcmmo.ability.repair.leatherrepair: true
mcmmo.ability.repair.ironrepair: true
mcmmo.ability.repair.goldrepair: true
mcmmo.ability.repair.diamondrepair: true
mcmmo.ability.repair.armorrepair: true
mcmmo.ability.repair.toolrepair: true
mcmmo.ability.repair.bowrepair: true
mcmmo.ability.repair.repairbonus:
description: Allows access to Super Repair bonus
mcmmo.ability.repair.arcaneforging:
description: Allows access to the Arcane Forging ability
mcmmo.ability.repair.woodrepair:
description: Allows ability to repair Wood tools
mcmmo.ability.repair.stonerepair:
description: Allows ability to repair Stone tools
mcmmo.ability.repair.leatherrepair:
description: Allows ability to repair Leather armor
mcmmo.ability.repair.ironrepair:
description: Allows ability to repair Iron tools & armor
mcmmo.ability.repair.goldrepair:
@ -233,6 +240,8 @@ permissions:
description: Allows ability to repair armor
mcmmo.ability.repair.toolrepair:
description: Allows ability to repair tools
mcmmo.ability.repair.bowrepair:
description: Allows ability to repair bows
mcmmo.ability.unarmed.*:
description: Allows access to all Unarmed abilities
children: