mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Updates to repair command, minor permission node & config updates
This commit is contained in:
parent
e1cf89c3bf
commit
e2265dd6f7
@ -26,6 +26,8 @@ Version 1.3.07
|
|||||||
! Changed MySQL to save player information 50ms apart from each other to reduce the load on the MySQL server
|
! Changed MySQL to save player information 50ms apart from each other to reduce the load on the MySQL server
|
||||||
! Changed the permission node for Blast Mining detonation to mcmmo.ability.blastmining.detonate (was mcmmo.skills.blastmining) for the sake of consistency
|
! Changed the permission node for Blast Mining detonation to mcmmo.ability.blastmining.detonate (was mcmmo.skills.blastmining) for the sake of consistency
|
||||||
- Removed some unused permission nodes
|
- Removed some unused permission nodes
|
||||||
|
- Removed a few config options in favor of permissions nodes (Hunger Bonus, Armor/Tool Repair, Instant Wheat Regrowth)
|
||||||
|
- Removed level requirement for repairing string tools from the config file
|
||||||
|
|
||||||
Version 1.3.06
|
Version 1.3.06
|
||||||
+ Added Iron Golem XP for aggressive golems
|
+ Added Iron Golem XP for aggressive golems
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.gmail.nossr50.commands.skills;
|
package com.gmail.nossr50.commands.skills;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -12,6 +14,7 @@ import com.gmail.nossr50.datatypes.SkillType;
|
|||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Repair;
|
import com.gmail.nossr50.skills.Repair;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class RepairCommand implements CommandExecutor {
|
public class RepairCommand implements CommandExecutor {
|
||||||
@ -19,6 +22,22 @@ public class RepairCommand implements CommandExecutor {
|
|||||||
private String repairMasteryBonus;
|
private String repairMasteryBonus;
|
||||||
private String superRepairChance;
|
private String superRepairChance;
|
||||||
|
|
||||||
|
private boolean canSuperRepair;
|
||||||
|
private boolean canMasterRepair;
|
||||||
|
private boolean canArcaneForge;
|
||||||
|
private boolean canRepairStone;
|
||||||
|
private boolean canRepairIron;
|
||||||
|
private boolean canRepairGold;
|
||||||
|
private boolean canRepairDiamond;
|
||||||
|
private boolean canRepairString;
|
||||||
|
private boolean canRepairLeather;
|
||||||
|
private boolean canRepairWood;
|
||||||
|
|
||||||
|
private int diamondLevel;
|
||||||
|
private int goldLevel;
|
||||||
|
private int ironLevel;
|
||||||
|
private int stoneLevel;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
if (CommandHelper.noConsoleUsage(sender)) {
|
if (CommandHelper.noConsoleUsage(sender)) {
|
||||||
@ -34,26 +53,73 @@ public class RepairCommand implements CommandExecutor {
|
|||||||
|
|
||||||
skillValue = (float) PP.getSkillLevel(SkillType.REPAIR);
|
skillValue = (float) PP.getSkillLevel(SkillType.REPAIR);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
permissionsCheck(player);
|
||||||
|
|
||||||
int arcaneForgingRank = Repair.getArcaneForgingRank(PP);
|
int arcaneForgingRank = Repair.getArcaneForgingRank(PP);
|
||||||
|
|
||||||
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Repair.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Repair.SkillName") }));
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Repair") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Repair") }));
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) }));
|
||||||
|
|
||||||
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.0"), LocaleLoader.getString("Repair.Effect.1") }));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.2"), LocaleLoader.getString("Repair.Effect.3") }));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.4"), LocaleLoader.getString("Repair.Effect.5") }));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.6", new Object[] { Config.getInstance().getRepairDiamondLevelRequirement() }), LocaleLoader.getString("Repair.Effect.7") }));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.8"), LocaleLoader.getString("Repair.Effect.9") }));
|
|
||||||
|
|
||||||
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
if (canArcaneForge || canRepairDiamond || canRepairGold || canRepairIron || canMasterRepair || canRepairStone || canSuperRepair || canRepairString || canRepairWood || canRepairLeather) {
|
||||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.Mastery", new Object[] { repairMasteryBonus }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.Super.Chance", new Object[] { superRepairChance }));
|
}
|
||||||
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Rank", new Object[] { arcaneForgingRank }));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Chance.Success", new Object[] { Repair.getEnchantChance(arcaneForgingRank) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.0"), LocaleLoader.getString("Repair.Effect.1") }));
|
||||||
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Chance.Downgrade", new Object[] { Repair.getDowngradeChance(arcaneForgingRank) }));
|
|
||||||
|
if (canMasterRepair) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.2"), LocaleLoader.getString("Repair.Effect.3") }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canSuperRepair) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.4"), LocaleLoader.getString("Repair.Effect.5") }));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Repair Level Requirements */
|
||||||
|
|
||||||
|
if (canRepairStone && stoneLevel > 0) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.14", new Object[] { stoneLevel }), LocaleLoader.getString("Repair.Effect.15") }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canRepairIron && ironLevel > 0) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.12", new Object[] { ironLevel }), LocaleLoader.getString("Repair.Effect.13") }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canRepairGold && goldLevel > 0) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.10", new Object[] { goldLevel }), LocaleLoader.getString("Repair.Effect.11") }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canRepairDiamond && diamondLevel > 0) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.6", new Object[] { diamondLevel }), LocaleLoader.getString("Repair.Effect.7") }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canArcaneForge) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.8"), LocaleLoader.getString("Repair.Effect.9") }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canArcaneForge || canMasterRepair || canSuperRepair) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canMasterRepair) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.Mastery", new Object[] { repairMasteryBonus }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canSuperRepair) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.Super.Chance", new Object[] { superRepairChance }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canArcaneForge) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Rank", new Object[] { arcaneForgingRank }));
|
||||||
|
|
||||||
|
if (Config.getInstance().getArcaneForgingEnchantLossEnabled()) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Chance.Success", new Object[] { Repair.getEnchantChance(arcaneForgingRank) }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config.getInstance().getArcaneForgingDowngradeEnabled()) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Chance.Downgrade", new Object[] { Repair.getDowngradeChance(arcaneForgingRank) }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.REPAIR, player, args);
|
Page.grabGuidePageForSkill(SkillType.REPAIR, player, args);
|
||||||
|
|
||||||
@ -61,13 +127,36 @@ public class RepairCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void dataCalculations(float skillValue) {
|
private void dataCalculations(float skillValue) {
|
||||||
repairMasteryBonus = String.valueOf(skillValue / 5);
|
DecimalFormat percent = new DecimalFormat("##0.00%");
|
||||||
|
Config configInstance = Config.getInstance();
|
||||||
|
|
||||||
|
diamondLevel = configInstance.getRepairDiamondLevelRequirement();
|
||||||
|
goldLevel = configInstance.getRepairGoldLevelRequirement();
|
||||||
|
ironLevel = configInstance.getRepairIronLevelRequirement();
|
||||||
|
stoneLevel = configInstance.getRepairStoneLevelRequirement();
|
||||||
|
|
||||||
|
repairMasteryBonus = percent.format(skillValue / 500);
|
||||||
|
|
||||||
if (skillValue >= 1000) {
|
if (skillValue >= 1000) {
|
||||||
superRepairChance = "100";
|
superRepairChance = "100.00%";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
superRepairChance = String.valueOf(skillValue / 10);
|
superRepairChance = percent.format(skillValue / 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void permissionsCheck(Player player) {
|
||||||
|
Permissions permInstance = Permissions.getInstance();
|
||||||
|
|
||||||
|
canSuperRepair = permInstance.repairBonus(player);
|
||||||
|
canMasterRepair = permInstance.repairMastery(player);
|
||||||
|
canArcaneForge = permInstance.arcaneForging(player);
|
||||||
|
canRepairDiamond = permInstance.diamondRepair(player);
|
||||||
|
canRepairGold = permInstance.goldRepair(player);
|
||||||
|
canRepairIron = permInstance.ironRepair(player);
|
||||||
|
canRepairStone = permInstance.stoneRepair(player);
|
||||||
|
canRepairString = permInstance.stringRepair(player);
|
||||||
|
canRepairLeather = permInstance.leatherRepair(player);
|
||||||
|
canRepairWood = permInstance.woodRepair(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,8 +139,6 @@ public class Config extends ConfigLoader {
|
|||||||
public int getHerbalismXPLilyPads() { return config.getInt("Experience.Herbalism.Lily_Pads", 100); }
|
public int getHerbalismXPLilyPads() { return config.getInt("Experience.Herbalism.Lily_Pads", 100); }
|
||||||
public int getHerbalismXPVines() { return config.getInt("Experience.Herbalism.Vines", 10); }
|
public int getHerbalismXPVines() { return config.getInt("Experience.Herbalism.Vines", 10); }
|
||||||
|
|
||||||
public boolean getHerbalismHungerBonusEnabled() { return config.getBoolean("Skills.Herbalism.Hunger_Bonus", true); }
|
|
||||||
public boolean getHerbalismWheatRegrowth() { return config.getBoolean("Skills.Herbalism.Instant_Wheat_Regrowth", true); }
|
|
||||||
public boolean getHerbalismGreenThumbCobbleToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); }
|
public boolean getHerbalismGreenThumbCobbleToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); }
|
||||||
public boolean getHerbalismGreenThumbSmoothbrickToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true); }
|
public boolean getHerbalismGreenThumbSmoothbrickToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true); }
|
||||||
public boolean getHerbalismGreenThumbDirtToGrass() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Dirt_To_Grass", true); }
|
public boolean getHerbalismGreenThumbDirtToGrass() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Dirt_To_Grass", true); }
|
||||||
@ -201,13 +199,10 @@ public class Config extends ConfigLoader {
|
|||||||
public int getRepairStringMaterial() { return config.getInt("Skills.Repair.String.ID", 287); }
|
public int getRepairStringMaterial() { return config.getInt("Skills.Repair.String.ID", 287); }
|
||||||
public int getRepairLeatherMaterial() { return config.getInt("Skills.Repair.Leather.ID", 334); }
|
public int getRepairLeatherMaterial() { return config.getInt("Skills.Repair.Leather.ID", 334); }
|
||||||
|
|
||||||
public boolean getRepairArmorAllowed() { return config.getBoolean("Skills.Repair.Can_Repair_Armor", true); }
|
|
||||||
public boolean getRepairToolsAllowed() { return config.getBoolean("Skills.Repair.Can_Repair_Tools", true); }
|
|
||||||
public int getRepairDiamondLevelRequirement() { return config.getInt("Skills.Repair.Diamond.Level_Required", 50); }
|
public int getRepairDiamondLevelRequirement() { return config.getInt("Skills.Repair.Diamond.Level_Required", 50); }
|
||||||
public int getRepairIronLevelRequirement() { return config.getInt("Skills.Repair.Iron.Level_Required", 0); }
|
public int getRepairIronLevelRequirement() { return config.getInt("Skills.Repair.Iron.Level_Required", 0); }
|
||||||
public int getRepairGoldLevelRequirement() { return config.getInt("Skills.Repair.Gold.Level_Required", 0); }
|
public int getRepairGoldLevelRequirement() { return config.getInt("Skills.Repair.Gold.Level_Required", 0); }
|
||||||
public int getRepairStoneLevelRequirement() { return config.getInt("Skills.Repair.Stone.Level_Required", 0); }
|
public int getRepairStoneLevelRequirement() { return config.getInt("Skills.Repair.Stone.Level_Required", 0); }
|
||||||
public int getRepairStringLevelRequirement() { return config.getInt("Skills.Repair.String.Level_Required", 0); }
|
|
||||||
|
|
||||||
/* Taming */
|
/* Taming */
|
||||||
public int getTamingXPWolf() { return config.getInt("Experience.Taming.Animal_Taming.Wolf", 250); }
|
public int getTamingXPWolf() { return config.getInt("Experience.Taming.Animal_Taming.Wolf", 250); }
|
||||||
@ -400,4 +395,4 @@ public class Config extends ConfigLoader {
|
|||||||
if(defaulthud == null)
|
if(defaulthud == null)
|
||||||
defaulthud = HUDType.STANDARD;
|
defaulthud = HUDType.STANDARD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,69 +215,67 @@ public class EntityListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler (priority = EventPriority.LOW)
|
@EventHandler (priority = EventPriority.LOW)
|
||||||
public void onFoodLevelChange(FoodLevelChangeEvent event) {
|
public void onFoodLevelChange(FoodLevelChangeEvent event) {
|
||||||
if (Config.getInstance().getHerbalismHungerBonusEnabled()) {
|
if (event.getEntity() instanceof Player) {
|
||||||
if (event.getEntity() instanceof Player) {
|
Player player = (Player) event.getEntity();
|
||||||
Player player = (Player) event.getEntity();
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
PlayerProfile PP = Users.getProfile(player);
|
int currentFoodLevel = player.getFoodLevel();
|
||||||
int currentFoodLevel = player.getFoodLevel();
|
int newFoodLevel = event.getFoodLevel();
|
||||||
int newFoodLevel = event.getFoodLevel();
|
|
||||||
|
|
||||||
if (!Permissions.getInstance().farmersDiet(player)) {
|
if (!Permissions.getInstance().farmersDiet(player)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Some foods have 3 ranks
|
||||||
|
* Some foods have 5 ranks
|
||||||
|
* The number of ranks is based on how 'common' the item is
|
||||||
|
* We can adjust this quite easily if we find something is giving too much of a bonus
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (newFoodLevel > currentFoodLevel) {
|
||||||
|
Material food = player.getItemInHand().getType();
|
||||||
|
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
|
||||||
|
int foodChange = newFoodLevel - currentFoodLevel;
|
||||||
|
int rankChange = 0;
|
||||||
|
|
||||||
|
switch (food) {
|
||||||
|
case BREAD:
|
||||||
|
/* BREAD RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */
|
||||||
|
rankChange = 200;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case COOKIE:
|
||||||
|
/* COOKIE RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */
|
||||||
|
rankChange = 400;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MELON:
|
||||||
|
/* MELON RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
|
||||||
|
rankChange = 400;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MUSHROOM_SOUP:
|
||||||
|
/* MUSHROOM SOUP RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ 1000 */
|
||||||
|
rankChange = 200;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
for (int i = 200; i <= 1000; i += rankChange) {
|
||||||
* Some foods have 3 ranks
|
if (herbLevel >= i) {
|
||||||
* Some foods have 5 ranks
|
foodChange++;
|
||||||
* The number of ranks is based on how 'common' the item is
|
|
||||||
* We can adjust this quite easily if we find something is giving too much of a bonus
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (newFoodLevel > currentFoodLevel) {
|
|
||||||
Material food = player.getItemInHand().getType();
|
|
||||||
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
|
|
||||||
int foodChange = newFoodLevel - currentFoodLevel;
|
|
||||||
int rankChange = 0;
|
|
||||||
|
|
||||||
switch (food) {
|
|
||||||
case BREAD:
|
|
||||||
/* BREAD RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */
|
|
||||||
rankChange = 200;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case COOKIE:
|
|
||||||
/* COOKIE RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */
|
|
||||||
rankChange = 400;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MELON:
|
|
||||||
/* MELON RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
|
|
||||||
rankChange = 400;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MUSHROOM_SOUP:
|
|
||||||
/* MUSHROOM SOUP RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ 1000 */
|
|
||||||
rankChange = 200;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 200; i <= 1000; i += rankChange) {
|
/* Make sure we don't go over the max value */
|
||||||
if (herbLevel >= i) {
|
newFoodLevel = currentFoodLevel + foodChange;
|
||||||
foodChange++;
|
if (newFoodLevel > 20) {
|
||||||
}
|
event.setFoodLevel(20);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
/* Make sure we don't go over the max value */
|
event.setFoodLevel(newFoodLevel);
|
||||||
newFoodLevel = currentFoodLevel + foodChange;
|
|
||||||
if (newFoodLevel > 20) {
|
|
||||||
event.setFoodLevel(20);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
event.setFoodLevel(newFoodLevel);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ public class Herbalism {
|
|||||||
mat = Material.WHEAT;
|
mat = Material.WHEAT;
|
||||||
xp = Config.getInstance().getHerbalismXPWheat();
|
xp = Config.getInstance().getHerbalismXPWheat();
|
||||||
|
|
||||||
if (Config.getInstance().getHerbalismWheatRegrowth() && Permissions.getInstance().greenThumbWheat(player)) {
|
if (Permissions.getInstance().greenThumbWheat(player)) {
|
||||||
greenThumbWheat(block, player, event, plugin);
|
greenThumbWheat(block, player, event, plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class Repair {
|
|||||||
/*
|
/*
|
||||||
* REPAIR ARMOR
|
* REPAIR ARMOR
|
||||||
*/
|
*/
|
||||||
if (ItemChecks.isArmor(is) && Config.getInstance().getRepairArmorAllowed() && Permissions.getInstance().armorRepair(player)) {
|
if (ItemChecks.isArmor(is) && Permissions.getInstance().armorRepair(player)) {
|
||||||
if (ItemChecks.isDiamondArmor(is) && inventory.contains(Config.getInstance().getRepairDiamondMaterial()) && skillLevel >= Config.getInstance().getRepairDiamondLevelRequirement() && Permissions.getInstance().diamondRepair(player)) {
|
if (ItemChecks.isDiamondArmor(is) && inventory.contains(Config.getInstance().getRepairDiamondMaterial()) && skillLevel >= Config.getInstance().getRepairDiamondLevelRequirement() && Permissions.getInstance().diamondRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairDiamondMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairDiamondMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 6, true);
|
xpHandler(player, PP, is, durabilityBefore, 6, true);
|
||||||
@ -72,7 +72,7 @@ public class Repair {
|
|||||||
/*
|
/*
|
||||||
* REPAIR TOOLS
|
* REPAIR TOOLS
|
||||||
*/
|
*/
|
||||||
else if (ItemChecks.isTool(is) && Config.getInstance().getRepairToolsAllowed() && Permissions.getInstance().toolRepair(player)) {
|
else if (ItemChecks.isTool(is) && Permissions.getInstance().toolRepair(player)) {
|
||||||
if (ItemChecks.isStoneTool(is) && inventory.contains(Config.getInstance().getRepairStoneMaterial()) && skillLevel >= Config.getInstance().getRepairStoneLevelRequirement() && Permissions.getInstance().stoneRepair(player)) {
|
if (ItemChecks.isStoneTool(is) && inventory.contains(Config.getInstance().getRepairStoneMaterial()) && skillLevel >= Config.getInstance().getRepairStoneLevelRequirement() && Permissions.getInstance().stoneRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairStoneMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairStoneMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||||
@ -93,7 +93,7 @@ public class Repair {
|
|||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairGoldMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairGoldMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 8, true);
|
xpHandler(player, PP, is, durabilityBefore, 8, true);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isStringTool(is) && inventory.contains(Config.getInstance().getRepairStringMaterial()) && skillLevel >= Config.getInstance().getRepairStringLevelRequirement() && Permissions.getInstance().stringRepair(player)){
|
else if (ItemChecks.isStringTool(is) && inventory.contains(Config.getInstance().getRepairStringMaterial()) && Permissions.getInstance().stringRepair(player)){
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairStringMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairStringMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||||
}
|
}
|
||||||
@ -291,8 +291,10 @@ public class Repair {
|
|||||||
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
|
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
|
||||||
float bonus = (float) skillLevel / 500;
|
float bonus = (float) skillLevel / 500;
|
||||||
|
|
||||||
bonus = (ramt * bonus);
|
if (Permissions.getInstance().repairMastery(player)) {
|
||||||
ramt += bonus;
|
bonus = (ramt * bonus);
|
||||||
|
ramt += bonus;
|
||||||
|
}
|
||||||
|
|
||||||
if (checkPlayerProcRepair(player)) {
|
if (checkPlayerProcRepair(player)) {
|
||||||
ramt = (short) (ramt * 2);
|
ramt = (short) (ramt * 2);
|
||||||
@ -303,6 +305,7 @@ public class Repair {
|
|||||||
if (durability < 0) {
|
if (durability < 0) {
|
||||||
durability = 0;
|
durability = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return durability;
|
return durability;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +156,10 @@ public class Permissions {
|
|||||||
return player.hasPermission("mcmmo.ability.repair.repairbonus");
|
return player.hasPermission("mcmmo.ability.repair.repairbonus");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean repairMastery(Player player) {
|
||||||
|
return player.hasPermission("mcmmo.ability.repair.repairmastery");
|
||||||
|
}
|
||||||
|
|
||||||
public boolean arcaneForging(Player player) {
|
public boolean arcaneForging(Player player) {
|
||||||
return player.hasPermission("mcmmo.ability.repair.arcaneforging");
|
return player.hasPermission("mcmmo.ability.repair.arcaneforging");
|
||||||
}
|
}
|
||||||
|
@ -130,8 +130,6 @@ Skills:
|
|||||||
Cobble_To_Mossy: true
|
Cobble_To_Mossy: true
|
||||||
SmoothBrick_To_MossyBrick: true
|
SmoothBrick_To_MossyBrick: true
|
||||||
Dirt_To_Grass: true
|
Dirt_To_Grass: true
|
||||||
Hunger_Bonus: true
|
|
||||||
Instant_Wheat_Regrowth: true
|
|
||||||
Mining:
|
Mining:
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Requires_Pickaxe: true
|
Requires_Pickaxe: true
|
||||||
@ -140,12 +138,9 @@ Skills:
|
|||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Anvil_Messages: true
|
Anvil_Messages: true
|
||||||
Anvil_ID: 42
|
Anvil_ID: 42
|
||||||
Can_Repair_Armor: true
|
|
||||||
Can_Repair_Tools: true
|
|
||||||
Leather:
|
Leather:
|
||||||
ID: 334
|
ID: 334
|
||||||
String:
|
String:
|
||||||
Level_Required: 0
|
|
||||||
ID: 287
|
ID: 287
|
||||||
Stone:
|
Stone:
|
||||||
Level_Required: 0
|
Level_Required: 0
|
||||||
|
@ -162,8 +162,8 @@ Mining.Effect.6=Bigger Bombs
|
|||||||
Mining.Effect.7=Increases TNT explosion radius
|
Mining.Effect.7=Increases TNT explosion radius
|
||||||
Mining.Effect.8=Demolitions Expertise
|
Mining.Effect.8=Demolitions Expertise
|
||||||
Mining.Effect.9=Decreases damage from TNT explosions
|
Mining.Effect.9=Decreases damage from TNT explosions
|
||||||
Mining.Effect.Decrease=[[RED]]Demolitions Expert Damage Decrease: [[YELLOW]]{0}%
|
Mining.Effect.Decrease=[[RED]]Demolitions Expert Damage Decrease: [[YELLOW]]{0}
|
||||||
Mining.Effect.DropChance=[[RED]]Double Drop Chance: [[YELLOW]]{0}%
|
Mining.Effect.DropChance=[[RED]]Double Drop Chance: [[YELLOW]]{0}
|
||||||
Mining.Listener=Mining:
|
Mining.Listener=Mining:
|
||||||
Mining.SkillName=MINING
|
Mining.SkillName=MINING
|
||||||
Mining.Skills.SuperBreaker.Off=[[RED]]**Super Breaker has worn off**
|
Mining.Skills.SuperBreaker.Off=[[RED]]**Super Breaker has worn off**
|
||||||
@ -190,7 +190,13 @@ Mining.Blast.Refresh=[[GREEN]]Your [[YELLOW]]Blast Mining [[GREEN]]ability is re
|
|||||||
|
|
||||||
#REPAIR
|
#REPAIR
|
||||||
Repair.Effect.0=Repair
|
Repair.Effect.0=Repair
|
||||||
Repair.Effect.1=Repair Iron Tools & Armor
|
Repair.Effect.1=Repair Tools & Armor
|
||||||
|
Repair.Effect.10=Gold Repair ({0}+ SKILL)
|
||||||
|
Repair.Effect.11=Repair Gold Tools & Armor
|
||||||
|
Repair.Effect.12=Iron Repair ({0}+ SKILL)
|
||||||
|
Repair.Effect.13=Repair Iron Tools & Armor
|
||||||
|
Repair.Effect.14=Stone Repair ({0}+ SKILL)
|
||||||
|
Repair.Effect.15=Repair Stone Tools
|
||||||
Repair.Effect.2=Repair Mastery
|
Repair.Effect.2=Repair Mastery
|
||||||
Repair.Effect.3=Increased repair amount
|
Repair.Effect.3=Increased repair amount
|
||||||
Repair.Effect.4=Super Repair
|
Repair.Effect.4=Super Repair
|
||||||
@ -208,9 +214,9 @@ Repair.Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron.
|
|||||||
Repair.Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone.
|
Repair.Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone.
|
||||||
Repair.Skills.FeltEasy=[[GRAY]]That felt easy.
|
Repair.Skills.FeltEasy=[[GRAY]]That felt easy.
|
||||||
Repair.Skills.FullDurability=[[GRAY]]That is at full durability.
|
Repair.Skills.FullDurability=[[GRAY]]That is at full durability.
|
||||||
Repair.Skills.Mastery=[[RED]]Repair Mastery: [[YELLOW]]Extra {0}% durability restored
|
Repair.Skills.Mastery=[[RED]]Repair Mastery: [[YELLOW]]Extra {0} durability restored
|
||||||
Repair.Skills.StackedItems=[[DARK_RED]]You can't repair stacked items.
|
Repair.Skills.StackedItems=[[DARK_RED]]You can't repair stacked items.
|
||||||
Repair.Skills.Super.Chance=[[RED]]Super Repair Chance: [[YELLOW]]{0}%
|
Repair.Skills.Super.Chance=[[RED]]Super Repair Chance: [[YELLOW]]{0}
|
||||||
Repair.Skillup=[[YELLOW]]Repair skill increased by {0}. Total ({1})
|
Repair.Skillup=[[YELLOW]]Repair skill increased by {0}. Total ({1})
|
||||||
|
|
||||||
##Arcane Forging
|
##Arcane Forging
|
||||||
|
@ -252,6 +252,7 @@ permissions:
|
|||||||
description: Allows access to all Repair abilities
|
description: Allows access to all Repair abilities
|
||||||
children:
|
children:
|
||||||
mcmmo.ability.repair.repairbonus: true
|
mcmmo.ability.repair.repairbonus: true
|
||||||
|
mcmmo.ability.repair.repairmastery: true
|
||||||
mcmmo.ability.repair.arcaneforging: true
|
mcmmo.ability.repair.arcaneforging: true
|
||||||
mcmmo.ability.repair.woodrepair: true
|
mcmmo.ability.repair.woodrepair: true
|
||||||
mcmmo.ability.repair.stonerepair: true
|
mcmmo.ability.repair.stonerepair: true
|
||||||
@ -264,6 +265,8 @@ permissions:
|
|||||||
mcmmo.ability.repair.stringrepair: true
|
mcmmo.ability.repair.stringrepair: 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.repairmastry:
|
||||||
|
description: Allows access to Repair Mastery
|
||||||
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:
|
mcmmo.ability.repair.woodrepair:
|
||||||
|
Loading…
Reference in New Issue
Block a user