mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Added permissions nodes for repairing wood, bows, and leather.
This commit is contained in:
parent
2c4418e6e6
commit
c8b30b6714
@ -88,7 +88,7 @@ public class LoadProperties extends ConfigLoader{
|
|||||||
public static Boolean anvilmessages;
|
public static Boolean anvilmessages;
|
||||||
public static int rWood, rStone, rIron, rGold, rDiamond, rString, rLeather;
|
public static int rWood, rStone, rIron, rGold, rDiamond, rString, rLeather;
|
||||||
public static int anvilID;
|
public static int anvilID;
|
||||||
public static int repairStoneLevel, repairIronLevel, repairGoldLevel, repairdiamondlevel;
|
public static int repairStoneLevel, repairIronLevel, repairGoldLevel, repairdiamondlevel, repairBowLevel;
|
||||||
|
|
||||||
/* Taming */
|
/* Taming */
|
||||||
public static int mtameWolf, mtameOcelot;
|
public static int mtameWolf, mtameOcelot;
|
||||||
@ -378,6 +378,7 @@ public class LoadProperties extends ConfigLoader{
|
|||||||
repairIronLevel = config.getInt("Skills.Repair.Iron.Level_Required", 0);
|
repairIronLevel = config.getInt("Skills.Repair.Iron.Level_Required", 0);
|
||||||
repairGoldLevel = config.getInt("Skills.Repair.Gold.Level_Required", 0);
|
repairGoldLevel = config.getInt("Skills.Repair.Gold.Level_Required", 0);
|
||||||
repairStoneLevel = config.getInt("Skills.Repair.Stone.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);
|
tamingxpmodifier = config.getDouble("Experience.Formula.Multiplier.Taming", 1.0);
|
||||||
miningxpmodifier = config.getDouble("Experience.Formula.Multiplier.Mining", 1.0);
|
miningxpmodifier = config.getDouble("Experience.Formula.Multiplier.Mining", 1.0);
|
||||||
|
@ -137,10 +137,18 @@ public class mcPermissions {
|
|||||||
return player.hasPermission("mcmmo.ability.repair.arcaneforging");
|
return player.hasPermission("mcmmo.ability.repair.arcaneforging");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean woodRepair(Player player) {
|
||||||
|
return player.hasPermission("mcmmo.ability.repair.woodrepair");
|
||||||
|
}
|
||||||
|
|
||||||
public boolean stoneRepair(Player player) {
|
public boolean stoneRepair(Player player) {
|
||||||
return player.hasPermission("mcmmo.ability.repair.stonerepair");
|
return player.hasPermission("mcmmo.ability.repair.stonerepair");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean leatherRepair(Player player) {
|
||||||
|
return player.hasPermission("mcmmo.ability.repair.leatherrepair");
|
||||||
|
}
|
||||||
|
|
||||||
public boolean ironRepair(Player player) {
|
public boolean ironRepair(Player player) {
|
||||||
return player.hasPermission("mcmmo.ability.repair.ironrepair");
|
return player.hasPermission("mcmmo.ability.repair.ironrepair");
|
||||||
}
|
}
|
||||||
@ -161,6 +169,10 @@ public class mcPermissions {
|
|||||||
return player.hasPermission("mcmmo.ability.repair.toolrepair");
|
return player.hasPermission("mcmmo.ability.repair.toolrepair");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean bowRepair(Player player) {
|
||||||
|
return player.hasPermission("mcmmo.ability.repair.bowrepair");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MCMMO.ABILITY.UNARMED.*
|
* MCMMO.ABILITY.UNARMED.*
|
||||||
*/
|
*/
|
||||||
|
@ -59,7 +59,7 @@ public class Repair {
|
|||||||
repairItem(player, is, new ItemStack(LoadProperties.rGold));
|
repairItem(player, is, new ItemStack(LoadProperties.rGold));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 4, true);
|
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));
|
repairItem(player, is, new ItemStack(LoadProperties.rLeather));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ public class Repair {
|
|||||||
repairItem(player, is, new ItemStack(LoadProperties.rStone));
|
repairItem(player, is, new ItemStack(LoadProperties.rStone));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
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));
|
repairItem(player, is, new ItemStack(LoadProperties.rWood));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ public class Repair {
|
|||||||
repairItem(player, is, new ItemStack(LoadProperties.rGold));
|
repairItem(player, is, new ItemStack(LoadProperties.rGold));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 8, true);
|
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));
|
repairItem(player, is, new ItemStack(LoadProperties.rString));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||||
}
|
}
|
||||||
|
@ -162,6 +162,7 @@ Skills:
|
|||||||
Leather:
|
Leather:
|
||||||
ID: 334
|
ID: 334
|
||||||
String:
|
String:
|
||||||
|
Level_Required: 0
|
||||||
ID: 287
|
ID: 287
|
||||||
Stone:
|
Stone:
|
||||||
Level_Required: 0
|
Level_Required: 0
|
||||||
|
@ -211,18 +211,25 @@ permissions:
|
|||||||
children:
|
children:
|
||||||
mcmmo.ability.repair.repairbonus: true
|
mcmmo.ability.repair.repairbonus: true
|
||||||
mcmmo.ability.repair.arcaneforging: true
|
mcmmo.ability.repair.arcaneforging: true
|
||||||
|
mcmmo.ability.repair.woodrepair: true
|
||||||
mcmmo.ability.repair.stonerepair: true
|
mcmmo.ability.repair.stonerepair: true
|
||||||
|
mcmmo.ability.repair.leatherrepair: true
|
||||||
mcmmo.ability.repair.ironrepair: true
|
mcmmo.ability.repair.ironrepair: true
|
||||||
mcmmo.ability.repair.goldrepair: true
|
mcmmo.ability.repair.goldrepair: true
|
||||||
mcmmo.ability.repair.diamondrepair: true
|
mcmmo.ability.repair.diamondrepair: true
|
||||||
mcmmo.ability.repair.armorrepair: true
|
mcmmo.ability.repair.armorrepair: true
|
||||||
mcmmo.ability.repair.toolrepair: true
|
mcmmo.ability.repair.toolrepair: true
|
||||||
|
mcmmo.ability.repair.bowrepair: true
|
||||||
mcmmo.ability.repair.repairbonus:
|
mcmmo.ability.repair.repairbonus:
|
||||||
description: Allows access to Super Repair bonus
|
description: Allows access to Super Repair bonus
|
||||||
mcmmo.ability.repair.arcaneforging:
|
mcmmo.ability.repair.arcaneforging:
|
||||||
description: Allows access to the Arcane Forging ability
|
description: Allows access to the Arcane Forging ability
|
||||||
|
mcmmo.ability.repair.woodrepair:
|
||||||
|
description: Allows ability to repair Wood tools
|
||||||
mcmmo.ability.repair.stonerepair:
|
mcmmo.ability.repair.stonerepair:
|
||||||
description: Allows ability to repair Stone tools
|
description: Allows ability to repair Stone tools
|
||||||
|
mcmmo.ability.repair.leatherrepair:
|
||||||
|
description: Allows ability to repair Leather armor
|
||||||
mcmmo.ability.repair.ironrepair:
|
mcmmo.ability.repair.ironrepair:
|
||||||
description: Allows ability to repair Iron tools & armor
|
description: Allows ability to repair Iron tools & armor
|
||||||
mcmmo.ability.repair.goldrepair:
|
mcmmo.ability.repair.goldrepair:
|
||||||
@ -233,6 +240,8 @@ permissions:
|
|||||||
description: Allows ability to repair armor
|
description: Allows ability to repair armor
|
||||||
mcmmo.ability.repair.toolrepair:
|
mcmmo.ability.repair.toolrepair:
|
||||||
description: Allows ability to repair tools
|
description: Allows ability to repair tools
|
||||||
|
mcmmo.ability.repair.bowrepair:
|
||||||
|
description: Allows ability to repair bows
|
||||||
mcmmo.ability.unarmed.*:
|
mcmmo.ability.unarmed.*:
|
||||||
description: Allows access to all Unarmed abilities
|
description: Allows access to all Unarmed abilities
|
||||||
children:
|
children:
|
||||||
|
Loading…
Reference in New Issue
Block a user