diff --git a/src/main/java/com/gmail/nossr50/Combat.java b/src/main/java/com/gmail/nossr50/Combat.java index e92751232..81c7512a4 100644 --- a/src/main/java/com/gmail/nossr50/Combat.java +++ b/src/main/java/com/gmail/nossr50/Combat.java @@ -352,10 +352,10 @@ public class Combat { String message = ""; if (type.equals(SkillType.AXES)) { - message = mcLocale.getString("Axes.HitByCleave"); + message = mcLocale.getString("Axes.Combat.Cleave.Struck"); } else if (type.equals(SkillType.SWORDS)) { - message = mcLocale.getString("Swords.HitBySerratedStrikes"); + message = mcLocale.getString("Swords.Combat.SS.Struck"); } dealDamage(defender, damageAmount, attacker); diff --git a/src/main/java/com/gmail/nossr50/Item.java b/src/main/java/com/gmail/nossr50/Item.java index 6f1fd3049..1dc461d7d 100644 --- a/src/main/java/com/gmail/nossr50/Item.java +++ b/src/main/java/com/gmail/nossr50/Item.java @@ -38,7 +38,7 @@ public class Item { for (int y = 0; block.getY() + y < player.getWorld().getMaxHeight(); y++) { if (!block.getRelative(0, y, 0).getType().equals(Material.AIR)) { - player.sendMessage(mcLocale.getString("Item.ChimaeraWingFail")); + player.sendMessage(mcLocale.getString("Item.ChimaeraWing.Fail")); player.teleport(block.getRelative(0, y - 1, 0).getLocation()); return; } @@ -51,10 +51,10 @@ public class Item { player.teleport(player.getWorld().getSpawnLocation()); } - player.sendMessage(mcLocale.getString("Item.ChimaeraWingPass")); + player.sendMessage(mcLocale.getString("Item.ChimaeraWing.Pass")); } else if (!Skills.cooldownOver(PP.getRecentlyHurt(), 60) && is.getAmount() >= LoadProperties.feathersConsumedByChimaeraWing) { - player.sendMessage(mcLocale.getString("Item.InjuredWait", new Object[] {Skills.calculateTimeLeft(PP.getRecentlyHurt(), 60)})); + player.sendMessage(mcLocale.getString("Item.Injured.Wait", new Object[] {Skills.calculateTimeLeft(PP.getRecentlyHurt(), 60)})); } else if (is.getAmount() <= LoadProperties.feathersConsumedByChimaeraWing) { player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(LoadProperties.chimaeraId)); diff --git a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java index 3d1242818..860fc6f42 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java @@ -48,7 +48,7 @@ public class InspectCommand implements CommandExecutor { CommandHelper.printGatheringSkills(player, sender); CommandHelper.printCombatSkills(player, sender); CommandHelper.printMiscSkills(player, sender); - sender.sendMessage(mcLocale.getString("mcPlayerListener.PowerLevel", new Object[] { PP.getPowerLevel() })); + sender.sendMessage(mcLocale.getString("Commands.PowerLevel", new Object[] { PP.getPowerLevel() })); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java index bdac6f9eb..a8e67f262 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java @@ -57,33 +57,28 @@ public class AxesCommand implements CommandExecutor { } private void dataCalculations(float skillValue) { + impactDamage = String.valueOf(5 + ((int) skillValue / 30)); + skullSplitterLength = String.valueOf(2 + ((int) skillValue / 50)); + if (skillValue >= 1000) { critChance = "37.5"; bonusDamage = "4"; - impactDamage = String.valueOf(5 + ((int) skillValue / 30)); greaterImpactDamage = "2"; - skullSplitterLength = String.valueOf(2 + ((int) skillValue / 50)); } else if (skillValue >= 750) { critChance = "37.5"; bonusDamage = "4"; - impactDamage = String.valueOf(5 + ((int) skillValue / 30)); greaterImpactDamage = "2"; - skullSplitterLength = String.valueOf(2 + ((int) skillValue / 50)); } else if (skillValue >= 200) { critChance = String.valueOf(skillValue / 20); bonusDamage = "4"; - impactDamage = String.valueOf(5 + ((int) skillValue / 30)); greaterImpactDamage = "2"; - skullSplitterLength = String.valueOf(2 + ((int) skillValue / 50)); } else { critChance = String.valueOf(skillValue / 20); bonusDamage = String.valueOf((int) skillValue / 50); - impactDamage = String.valueOf(5 + ((int) skillValue / 30)); greaterImpactDamage = "2"; - skullSplitterLength = String.valueOf(2 + ((int) skillValue / 50)); } } } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 2e95ed437..164a13ef7 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -6,7 +6,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.gmail.nossr50.Users; -import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -14,41 +13,42 @@ import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.util.Page; public class ExcavationCommand implements CommandExecutor { - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)) { - sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale. - return true; - } + private float skillValue; + private String gigaDrillBreakerLength; + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (CommandHelper.noConsoleUsage(sender)) { + return true; + } if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.excavation")) { return true; } - Player player = (Player) sender; - PlayerProfile PP = Users.getProfile(player); - int ticks = 2; - int x = PP.getSkillLevel(SkillType.EXCAVATION); - while (x >= 50) { - x -= 50; - ticks++; - } + Player player = (Player) sender; + PlayerProfile PP = Users.getProfile(player); - player.sendMessage(""); - player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Excavation.SkillName") })); - player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Excavation") })); + skillValue = (float) PP.getSkillLevel(SkillType.EXCAVATION); + dataCalculations(skillValue); - if (mcPermissions.getInstance().excavation(player)) - player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) })); + player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Excavation.SkillName") })); + player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Excavation") })); + player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) })); - player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsExcavation1_0"), mcLocale.getString("m.EffectsExcavation1_1") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsExcavation2_0"), mcLocale.getString("m.EffectsExcavation2_1") })); - player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") })); - player.sendMessage(mcLocale.getString("m.ExcavationGigaDrillBreakerLength", new Object[] { ticks })); + player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Excavation.Effect.0"), mcLocale.getString("Excavation.Effect.1") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Excavation.Effect.2"), mcLocale.getString("Excavation.Effect.3") })); - Page.grabGuidePageForSkill(SkillType.EXCAVATION, player, args); - - return true; - } + player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") })); + player.sendMessage(mcLocale.getString("Excavation.Effect.Length", new Object[] { gigaDrillBreakerLength })); + + Page.grabGuidePageForSkill(SkillType.EXCAVATION, player, args); + + return true; + } + + private void dataCalculations(float skillValue) { + gigaDrillBreakerLength = String.valueOf(2 + ((int) skillValue / 50)); + } } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index d8bede433..1da93d96b 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -6,7 +6,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.gmail.nossr50.Users; -import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -15,41 +14,42 @@ import com.gmail.nossr50.skills.Fishing; import com.gmail.nossr50.util.Page; public class FishingCommand implements CommandExecutor { - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)) { - sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale. - return true; - } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (CommandHelper.noConsoleUsage(sender)) { + return true; + } if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.fishing")) { return true; } - Player player = (Player) sender; - PlayerProfile PP = Users.getProfile(player); + Player player = (Player) sender; + PlayerProfile PP = Users.getProfile(player); - player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Fishing.SkillName") })); - player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Fishing") })); + player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Fishing.SkillName") })); + player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Fishing") })); + player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) })); - if (mcPermissions.getInstance().fishing(player)) - player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) })); + player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Fishing.Effect.0"), mcLocale.getString("Fishing.Effect.1") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Fishing.Effect.2"), mcLocale.getString("Fishing.Effect.3") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Fishing.Effect.4"), mcLocale.getString("Fishing.Effect.5") })); - player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsFishing1_0"), mcLocale.getString("m.EffectsFishing1_1") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsFishing2_0"), mcLocale.getString("m.EffectsFishing2_1") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsFishing3_0"), mcLocale.getString("m.EffectsFishing3_1") })); - player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") })); - player.sendMessage(mcLocale.getString("m.FishingRank", new Object[] { Fishing.getFishingLootTier(PP) })); - player.sendMessage(mcLocale.getString("m.FishingMagicInfo")); + player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") })); + player.sendMessage(mcLocale.getString("Fishing.Ability.Rank", new Object[] { Fishing.getFishingLootTier(PP) })); + player.sendMessage(mcLocale.getString("Fishing.Ability.Info")); - if (PP.getSkillLevel(SkillType.FISHING) < 150) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockFishing1") })); - else - player.sendMessage(mcLocale.getString("m.ShakeInfo", new Object[] { Fishing.getFishingLootTier(PP) })); - - Page.grabGuidePageForSkill(SkillType.FISHING, player, args); + //TODO: Do we really need to display this twice? Not like there are any associated stats. + if (PP.getSkillLevel(SkillType.FISHING) < 150) { + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Fishing.Ability.Locked.0") })); + } + else { + player.sendMessage(mcLocale.getString("Fishing.Ability.Shake")); + } - return true; - } + Page.grabGuidePageForSkill(SkillType.FISHING, player, args); + + return true; + } } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java index 41ab94917..3ac8b78c8 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java @@ -6,7 +6,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.gmail.nossr50.Users; -import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -14,64 +13,96 @@ import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.util.Page; public class HerbalismCommand implements CommandExecutor { - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)) { - sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale. - return true; - } + private float skillValue; + private String greenTerraLength; + private String greenThumbChance; + private String greenThumbStage; + private String farmersDietRank; + private String doubleDropChance; + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (CommandHelper.noConsoleUsage(sender)) { + return true; + } if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.herbalism")) { return true; } - - Player player = (Player) sender; - PlayerProfile PP = Users.getProfile(player); - int bonus = 0; - if (PP.getSkillLevel(SkillType.HERBALISM) >= 200) - bonus++; - if (PP.getSkillLevel(SkillType.HERBALISM) >= 400) - bonus++; - if (PP.getSkillLevel(SkillType.HERBALISM) >= 600) - bonus++; - if (PP.getSkillLevel(SkillType.HERBALISM) >= 800) - bonus++; - if (PP.getSkillLevel(SkillType.HERBALISM) >= 1000) - bonus++; + Player player = (Player) sender; + PlayerProfile PP = Users.getProfile(player); - int ticks = 2; - int x = PP.getSkillLevel(SkillType.HERBALISM); - while (x >= 50) { - x -= 50; - ticks++; - } + skillValue = (float) PP.getSkillLevel(SkillType.HERBALISM); + dataCalculations(skillValue); - float skillvalue = (float) PP.getSkillLevel(SkillType.HERBALISM); + player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Herbalism.SkillName") })); + player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Herbalism") })); + player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) })); - String percentage = String.valueOf((skillvalue / 1000) * 100); - String gpercentage = String.valueOf((skillvalue / 1500) * 100); - player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Herbalism.SkillName") })); - player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Herbalism") })); + player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.0"), mcLocale.getString("Herbalism.Effect.1") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.2"), mcLocale.getString("Herbalism.Effect.3") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.4"), mcLocale.getString("Herbalism.Effect.5") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.6"), mcLocale.getString("Herbalism.Effect.7") })); + player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.8"), mcLocale.getString("Herbalism.Effect.9") })); - if (mcPermissions.getInstance().herbalism(player)) - player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) })); + player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") })); + player.sendMessage(mcLocale.getString("Herbalism.Ability.GTe.Length", new Object[] { greenTerraLength })); + player.sendMessage(mcLocale.getString("Herbalism.Ability.GTh.Chance", new Object[] { greenThumbChance })); + player.sendMessage(mcLocale.getString("Herbalism.Ability.GTh.Stage", new Object[] { greenThumbStage })); + player.sendMessage(mcLocale.getString("Herbalism.Ability.FD", new Object[] { farmersDietRank } )); + player.sendMessage(mcLocale.getString("Herbalism.Ability.DoubleDropChance", new Object[] { doubleDropChance })); - player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsHerbalism1_0"), mcLocale.getString("m.EffectsHerbalism1_1") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsHerbalism2_0"), mcLocale.getString("m.EffectsHerbalism2_1") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsHerbalism3_0"), mcLocale.getString("m.EffectsHerbalism3_1") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsHerbalism4_0"), mcLocale.getString("m.EffectsHerbalism4_1") })); - player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsHerbalism5_0"), mcLocale.getString("m.EffectsHerbalism5_1") })); - player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") })); - player.sendMessage(mcLocale.getString("m.HerbalismGreenTerraLength", new Object[] { ticks })); - player.sendMessage(mcLocale.getString("m.HerbalismGreenThumbChance", new Object[] { gpercentage })); - player.sendMessage(mcLocale.getString("m.HerbalismGreenThumbStage", new Object[] { bonus })); - player.sendMessage(mcLocale.getString("m.HerbalismFoodPlus", new Object[] { bonus } )); - player.sendMessage(mcLocale.getString("m.HerbalismDoubleDropChance", new Object[] { percentage })); - - Page.grabGuidePageForSkill(SkillType.HERBALISM, player, args); + Page.grabGuidePageForSkill(SkillType.HERBALISM, player, args); - return true; - } + return true; + } + + private void dataCalculations(float skillValue) { + greenTerraLength = String.valueOf(2 + ((int) skillValue / 50)); + + if (skillValue >= 1500) { + greenThumbChance = "100"; + greenThumbStage = "4"; + farmersDietRank = "5"; + doubleDropChance = "100"; + } + else if (skillValue >= 1000) { + greenThumbChance = String.valueOf(skillValue / 15); + greenThumbStage = "4"; + farmersDietRank = "5"; + doubleDropChance = "100"; + } + else if (skillValue >= 800) { + greenThumbChance = String.valueOf(skillValue / 15); + greenThumbStage = "4"; + farmersDietRank = "4"; + doubleDropChance = String.valueOf(skillValue / 10); + } + else if (skillValue >= 600) { + greenThumbChance = String.valueOf(skillValue / 15); + greenThumbStage = "4"; + farmersDietRank = "3"; + doubleDropChance = String.valueOf(skillValue / 10); + } + else if (skillValue >= 400) { + greenThumbChance = String.valueOf(skillValue / 15); + greenThumbStage = "3"; + farmersDietRank = "2"; + doubleDropChance = String.valueOf(skillValue / 10); + } + else if (skillValue >= 200) { + greenThumbChance = String.valueOf(skillValue / 15); + greenThumbStage = "2"; + farmersDietRank = "1"; + doubleDropChance = String.valueOf(skillValue / 10); + } + else { + greenThumbChance = String.valueOf(skillValue / 15); + greenThumbStage = "1"; + farmersDietRank = "1"; + doubleDropChance = String.valueOf(skillValue / 10); + } + } } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index 6c7f00bf2..dbecd1e2d 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -92,7 +92,7 @@ public class MiningCommand implements CommandExecutor { player.sendMessage(mcLocale.getString("m.MiningDoubleDropChance", new Object[] { percentage })); player.sendMessage(mcLocale.getString("m.MiningSuperBreakerLength", new Object[] { ticks })); if (PP.getSkillLevel(SkillType.MINING) < 125) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockMining1") })); + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("m.AbilLockMining1") })); else{ switch (rank){ case 1: @@ -122,11 +122,11 @@ public class MiningCommand implements CommandExecutor { } } if (PP.getSkillLevel(SkillType.MINING) < 250) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockMining2") })); + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("m.AbilLockMining2") })); else player.sendMessage(mcLocale.getString("m.MiningBiggerBombs", new Object[] { radius })); if (PP.getSkillLevel(SkillType.MINING) < 500) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockMining3") })); + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("m.AbilLockMining3") })); else player.sendMessage(mcLocale.getString("m.MiningDemolitionsExpertDamageDecrease", new Object[] { damage })); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java index f2e8f3bda..802e8b15e 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java @@ -50,26 +50,26 @@ public class TamingCommand implements CommandExecutor { player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") })); if (PP.getSkillLevel(SkillType.TAMING) < 100) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockTaming1") })); + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("m.AbilLockTaming1") })); else player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("m.AbilBonusTaming1_0"), mcLocale.getString("m.AbilBonusTaming1_1") })); if (PP.getSkillLevel(SkillType.TAMING) < 250) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockTaming2") })); + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("m.AbilLockTaming2") })); else player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("m.AbilBonusTaming2_0"), mcLocale.getString("m.AbilBonusTaming2_1") })); if (PP.getSkillLevel(SkillType.TAMING) < 500) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockTaming3") })); + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("m.AbilLockTaming3") })); else player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("m.AbilBonusTaming3_0"), mcLocale.getString("m.AbilBonusTaming3_1") })); if (PP.getSkillLevel(SkillType.TAMING) < 750) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockTaming4") })); + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("m.AbilLockTaming4") })); else player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("m.AbilBonusTaming4_0"), mcLocale.getString("m.AbilBonusTaming4_1") })); if (PP.getSkillLevel(SkillType.TAMING) < 50) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockTaming5") })); + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("m.AbilLockTaming5") })); else player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("m.AbilBonusTaming5_0"), mcLocale.getString("m.AbilBonusTaming5_1") })); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java index c0132823e..1fb17d120 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java @@ -49,7 +49,7 @@ public class WoodcuttingCommand implements CommandExecutor { player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") })); if (PP.getSkillLevel(SkillType.WOODCUTTING) < 100) - player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockWoodCutting1") })); + player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("m.AbilLockWoodCutting1") })); else player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("m.AbilBonusWoodCutting1_0"), mcLocale.getString("m.AbilBonusWoodCutting1_1") })); diff --git a/src/main/java/com/gmail/nossr50/datatypes/AbilityType.java b/src/main/java/com/gmail/nossr50/datatypes/AbilityType.java index 0a4906b35..32ee9f856 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/AbilityType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/AbilityType.java @@ -1,134 +1,196 @@ -package com.gmail.nossr50.datatypes; - -import org.bukkit.Material; -import org.bukkit.entity.Player; - -import com.gmail.nossr50.mcPermissions; -import com.gmail.nossr50.config.LoadProperties; -import com.gmail.nossr50.locale.mcLocale; -import com.gmail.nossr50.skills.Excavation; -import com.gmail.nossr50.skills.Herbalism; -import com.gmail.nossr50.skills.Mining; - -public enum AbilityType { - BERSERK(LoadProperties.berserkCooldown, mcLocale.getString("Skills.BerserkOn"), mcLocale.getString("Skills.BerserkOff"), "Skills.BerserkPlayer", mcLocale.getString("Skills.YourBerserk"), "Skills.BerserkPlayerOff"), - SUPER_BREAKER(LoadProperties.superBreakerCooldown, mcLocale.getString("Skills.SuperBreakerOn"), mcLocale.getString("Skills.SuperBreakerOff"), "Skills.SuperBreakerPlayer", mcLocale.getString("Skills.YourSuperBreaker"), "Skills.SuperBreakerPlayerOff"), - GIGA_DRILL_BREAKER(LoadProperties.gigaDrillBreakerCooldown, mcLocale.getString("Skills.GigaDrillBreakerOn"), mcLocale.getString("Skills.GigaDrillBreakerOff"), "Skills.GigaDrillBreakerPlayer", mcLocale.getString("Skills.YourGigaDrillBreaker"), "Skills.GigaDrillBreakerPlayerOff"), - GREEN_TERRA(LoadProperties.greenTerraCooldown, mcLocale.getString("Skills.GreenTerraOn"), mcLocale.getString("Skills.GreenTerraOff"), "Skills.GreenTerraPlayer", mcLocale.getString("Skills.YourGreenTerra"), mcLocale.getString("Skills.GreenTerraPlayerOff")), - SKULL_SPLIITER(LoadProperties.skullSplitterCooldown, mcLocale.getString("Skills.SkullSplitterOn"), mcLocale.getString("Skills.SkullSplitterOff"), "Skills.SkullSplitterPlayer", mcLocale.getString("Skills.YourSkullSplitter"), "Skills.SkullSplitterPlayerOff"), - TREE_FELLER(LoadProperties.treeFellerCooldown, mcLocale.getString("Skills.TreeFellerOn"), mcLocale.getString("Skills.TreeFellerOff"), "Skills.TreeFellerPlayer", mcLocale.getString("Skills.YourTreeFeller"), "Skills.TreeFellerPlayerOff"), - SERRATED_STRIKES(LoadProperties.skullSplitterCooldown, mcLocale.getString("Skills.SerratedStrikesOn"), mcLocale.getString("Skills.SerratedStrikesOff"), "Skills.SerratedStrikesPlayer", mcLocale.getString("Skills.YourSerratedStrikes"), "Skills.SerratedStrikesPlayerOff"), - BLAST_MINING(LoadProperties.blastMiningCooldown, null, null, "Skills.BlastMiningPlayer", mcLocale.getString("Skills.YourBlastMining"), null), - LEAF_BLOWER(0, null, null, null, null, null); - - private int cooldown; - private String abilityOn; - private String abilityOff; - private String abilityPlayer; - private String abilityRefresh; - private String abilityPlayerOff; - - private AbilityType(int cooldown, String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) { - this.cooldown = cooldown; - this.abilityOn = abilityOn; - this.abilityOff = abilityOff; - this.abilityPlayer = abilityPlayer; - this.abilityRefresh = abilityRefresh; - this.abilityPlayerOff = abilityPlayerOff; - } - - public int getCooldown() { - return this.cooldown; - } - - public String getAbilityOn() { - return this.abilityOn; - } - - public String getAbilityOff() { - return this.abilityOff; - } - - public String getAbilityPlayer(Player player) { - return mcLocale.getString(this.abilityPlayer, new Object[] {player.getName()}); - } - - public String getAbilityPlayerOff(Player player) { - return mcLocale.getString(this.abilityPlayerOff, new Object[] {player.getName()}); - } - - public String getAbilityRefresh() { - return this.abilityRefresh; - } - - /** - * Get the permissions for this ability. - * - * @param player Player to check permissions for - * @return true if the player has permissions, false otherwise - */ - public boolean getPermissions(Player player) { - switch (this) { - case BERSERK: - return mcPermissions.getInstance().berserk(player); - - case BLAST_MINING: - return mcPermissions.getInstance().blastMining(player); - - case GIGA_DRILL_BREAKER: - return mcPermissions.getInstance().gigaDrillBreaker(player); - - case GREEN_TERRA: - return mcPermissions.getInstance().greenTerra(player); - - case LEAF_BLOWER: - return mcPermissions.getInstance().leafBlower(player); - - case SERRATED_STRIKES: - return mcPermissions.getInstance().serratedStrikes(player); - - case SKULL_SPLIITER: - return mcPermissions.getInstance().skullSplitter(player); - - case SUPER_BREAKER: - return mcPermissions.getInstance().superBreaker(player); - - case TREE_FELLER: - return mcPermissions.getInstance().treeFeller(player); - - default: - return false; - } - } - - /** - * Check if a block is affected by this ability. - * - * @param material The block type to check - * @return true if the block is affected by this ability, false otherwise - */ - public boolean blockCheck(Material material) { - switch (this) { - case BERSERK: - return (Excavation.canBeGigaDrillBroken(material) || material.equals(Material.SNOW)); - - case GIGA_DRILL_BREAKER: - return Excavation.canBeGigaDrillBroken(material); - - case GREEN_TERRA: - return Herbalism.makeMossy(material); - - case LEAF_BLOWER: - return material.equals(Material.LEAVES); - - case SUPER_BREAKER: - return Mining.canBeSuperBroken(material); - - case TREE_FELLER: - return material.equals(Material.LOG); - - default: - return false; - } - } -} +package com.gmail.nossr50.datatypes; + +import org.bukkit.Material; +import org.bukkit.entity.Player; + +import com.gmail.nossr50.mcPermissions; +import com.gmail.nossr50.config.LoadProperties; +import com.gmail.nossr50.locale.mcLocale; +import com.gmail.nossr50.skills.Excavation; +import com.gmail.nossr50.skills.Herbalism; +import com.gmail.nossr50.skills.Mining; + +public enum AbilityType { + BERSERK( + LoadProperties.berserkCooldown, + "Unarmed.Skills.Berserk.On", + "Unarmed.Skills.Berserk.Off", + "Unarmed.Skills.Berserk.Other.On", + "Unarmed.Skills.Berserk.Refresh", + "Unarmed.Skills.Berserk.Other.Off"), + + SUPER_BREAKER( + LoadProperties.superBreakerCooldown, + "Mining.Skills.SuperBreaker.On", + "Mining.Skills.SuperBreaker.Off", + "Mining.Skills.SuperBreaker.Other.On", + "Mining.Skills.SuperBreaker.Refresh", + "Mining.Skills.SuperBreaker.Other.Off"), + + GIGA_DRILL_BREAKER( + LoadProperties.gigaDrillBreakerCooldown, + "Excavation.Skills.GigaDrillBreaker.On", + "Excavation.Skills.GigaDrillBreaker.Off", + "Excavation.Skills.GigaDrillBreaker.Other.On", + "Excavation.Skills.GigaDrillBreaker.Refresh", + "Excavation.Skills.GigaDrillBreaker.Other.Off"), + + GREEN_TERRA( + LoadProperties.greenTerraCooldown, + "Herbalism.Skills.GTe.On", + "Herbalism.Skills.GTe.Off", + "Herbalism.Skills.GTe.Other.On", + "Herbalism.Skills.GTe.Refresh", + "Herbalism.Skills.GTe.Other.Off"), + + SKULL_SPLIITER( + LoadProperties.skullSplitterCooldown, + "Axes.Skills.SS.On", + "Axes.Skills.SS.Off", + "Axes.Skills.SS.Other.On", + "Axes.Skills.SS.Refresh", + "Axes.Skills.SS.Other.Off"), + + TREE_FELLER( + LoadProperties.treeFellerCooldown, + "Woodcutting.Skills.TreeFeller.On", + "Woodcutting.Skills.TreeFeller.Off", + "Woodcutting.Skills.TreeFeller.Other.On", + "Woodcutting.Skills.TreeFeller.Refresh", + "Woodcutting.Skills.TreeFeller.Other.Off"), + + SERRATED_STRIKES( + LoadProperties.serratedStrikeCooldown, + "Swords.Skills.SS.On", + "Swords.Skills.SS.Off", + "Swords.Skills.SS.Other.On", + "Swords.Skills.SS.Refresh", + "Swords.Skills.SS.Other.Off"), + + BLAST_MINING( + LoadProperties.blastMiningCooldown, + null, + null, + "Mining.Blast.Other.On", + "Mining.Blast.Refresh", + null), + + LEAF_BLOWER( + 0, + null, + null, + null, + null, + null); + + private int cooldown; + private String abilityOn; + private String abilityOff; + private String abilityPlayer; + private String abilityRefresh; + private String abilityPlayerOff; + + private AbilityType(int cooldown, String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) { + this.cooldown = cooldown; + this.abilityOn = abilityOn; + this.abilityOff = abilityOff; + this.abilityPlayer = abilityPlayer; + this.abilityRefresh = abilityRefresh; + this.abilityPlayerOff = abilityPlayerOff; + } + + public int getCooldown() { + return this.cooldown; + } + + public String getAbilityOn() { + return mcLocale.getString(this.abilityOn); + } + + public String getAbilityOff() { + return mcLocale.getString(this.abilityOff); + } + + public String getAbilityPlayer(Player player) { + return mcLocale.getString(this.abilityPlayer, new Object[] {player.getName()}); + } + + public String getAbilityPlayerOff(Player player) { + return mcLocale.getString(this.abilityPlayerOff, new Object[] {player.getName()}); + } + + public String getAbilityRefresh() { + return mcLocale.getString(this.abilityRefresh); + } + + /** + * Get the permissions for this ability. + * + * @param player Player to check permissions for + * @return true if the player has permissions, false otherwise + */ + public boolean getPermissions(Player player) { + switch (this) { + case BERSERK: + return mcPermissions.getInstance().berserk(player); + + case BLAST_MINING: + return mcPermissions.getInstance().blastMining(player); + + case GIGA_DRILL_BREAKER: + return mcPermissions.getInstance().gigaDrillBreaker(player); + + case GREEN_TERRA: + return mcPermissions.getInstance().greenTerra(player); + + case LEAF_BLOWER: + return mcPermissions.getInstance().leafBlower(player); + + case SERRATED_STRIKES: + return mcPermissions.getInstance().serratedStrikes(player); + + case SKULL_SPLIITER: + return mcPermissions.getInstance().skullSplitter(player); + + case SUPER_BREAKER: + return mcPermissions.getInstance().superBreaker(player); + + case TREE_FELLER: + return mcPermissions.getInstance().treeFeller(player); + + default: + return false; + } + } + + /** + * Check if a block is affected by this ability. + * + * @param material The block type to check + * @return true if the block is affected by this ability, false otherwise + */ + public boolean blockCheck(Material material) { + switch (this) { + case BERSERK: + return (Excavation.canBeGigaDrillBroken(material) || material.equals(Material.SNOW)); + + case GIGA_DRILL_BREAKER: + return Excavation.canBeGigaDrillBroken(material); + + case GREEN_TERRA: + return Herbalism.makeMossy(material); + + case LEAF_BLOWER: + return material.equals(Material.LEAVES); + + case SUPER_BREAKER: + return Mining.canBeSuperBroken(material); + + case TREE_FELLER: + return material.equals(Material.LOG); + + default: + return false; + } + } +} diff --git a/src/main/java/com/gmail/nossr50/datatypes/ToolType.java b/src/main/java/com/gmail/nossr50/datatypes/ToolType.java index cf898bba9..50d779908 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/ToolType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/ToolType.java @@ -7,12 +7,12 @@ import com.gmail.nossr50.ItemChecks; import com.gmail.nossr50.locale.mcLocale; public enum ToolType { - AXE(mcLocale.getString("Skills.LowerAxe"), mcLocale.getString("Skills.ReadyAxe")), - FISTS(mcLocale.getString("Skills.LowerFists"), mcLocale.getString("Skills.ReadyFists")), - HOE(mcLocale.getString("Skills.LowerHoe"), mcLocale.getString("Skills.ReadyHoe")), - PICKAXE(mcLocale.getString("Skills.LowerPickAxe"), mcLocale.getString("Skills.ReadyPickAxe")), - SHOVEL(mcLocale.getString("Skills.LowerShovel"), mcLocale.getString("Skills.ReadyShovel")), - SWORD(mcLocale.getString("Skills.LowerSword"), mcLocale.getString("Skills.ReadySword")); + AXE(mcLocale.getString("Axes.Ability.Lower"), mcLocale.getString("Axes.Ability.Ready")), + FISTS(mcLocale.getString("Unarmed.Ability.Lower"), mcLocale.getString("Unarmed.Ability.Ready")), + HOE(mcLocale.getString("Herbalism.Ability.Lower"), mcLocale.getString("Herbalism.Ability.Ready")), + PICKAXE(mcLocale.getString("Mining.Ability.Lower"), mcLocale.getString("Mining.Ability.Ready")), + SHOVEL(mcLocale.getString("Excavation.Ability.Lower"), mcLocale.getString("Excavation.Ability.Ready")), + SWORD(mcLocale.getString("Swords.Ability.Lower"), mcLocale.getString("Swords.Ability.Ready")); private String lowerTool; private String raiseTool; diff --git a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java index 1b35fdaab..49423cfe5 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java @@ -226,7 +226,8 @@ public class mcEntityListener implements Listener { int currentFoodLevel = player.getFoodLevel(); int newFoodLevel = event.getFoodLevel(); - /* Some foods have 3 ranks + /* + * 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 diff --git a/src/main/java/com/gmail/nossr50/listeners/mcPlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/mcPlayerListener.java index 16b6e35b6..0c19f7811 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcPlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcPlayerListener.java @@ -169,7 +169,7 @@ public class mcPlayerListener implements Listener { if (mcPermissions.getInstance().motd(player) && LoadProperties.enableMotd) { player.sendMessage(mcLocale.getString("mcMMO.MOTD", new Object[] {plugin.getDescription().getVersion()})); - player.sendMessage(mcLocale.getString("McMMO.Wiki")); + player.sendMessage(mcLocale.getString("mcMMO.Wiki")); } //THIS IS VERY BAD WAY TO DO THINGS, NEED BETTER WAY diff --git a/src/main/java/com/gmail/nossr50/runnables/mcBleedTimer.java b/src/main/java/com/gmail/nossr50/runnables/mcBleedTimer.java index 4b671139b..68a27596d 100644 --- a/src/main/java/com/gmail/nossr50/runnables/mcBleedTimer.java +++ b/src/main/java/com/gmail/nossr50/runnables/mcBleedTimer.java @@ -54,7 +54,7 @@ public class mcBleedTimer implements Runnable { PP.decreaseBleedTicks(); if (PP.getBleedTicks() == 0) { - player.sendMessage(mcLocale.getString("Swords.StoppedBleeding")); + player.sendMessage(mcLocale.getString("Swords.Combat.Bleeding.Stopped")); } } } diff --git a/src/main/java/com/gmail/nossr50/runnables/mcTimer.java b/src/main/java/com/gmail/nossr50/runnables/mcTimer.java index 977fa23f3..275c94707 100644 --- a/src/main/java/com/gmail/nossr50/runnables/mcTimer.java +++ b/src/main/java/com/gmail/nossr50/runnables/mcTimer.java @@ -34,25 +34,20 @@ public class mcTimer implements Runnable { /* * MONITOR SKILLS */ - Skills.monitorSkill(player, PP, curTime, SkillType.AXES); - Skills.monitorSkill(player, PP, curTime, SkillType.EXCAVATION); - Skills.monitorSkill(player, PP, curTime, SkillType.HERBALISM); - Skills.monitorSkill(player, PP, curTime, SkillType.MINING); - Skills.monitorSkill(player, PP, curTime, SkillType.SWORDS); - Skills.monitorSkill(player, PP, curTime, SkillType.UNARMED); - Skills.monitorSkill(player, PP, curTime, SkillType.WOODCUTTING); + for (SkillType skill : SkillType.values()) { + if (skill.getTool() != null && skill.getAbility() != null) { + Skills.monitorSkill(player, PP, curTime, skill); + } + } /* * COOLDOWN MONITORING */ - Skills.watchCooldown(player, PP, curTime, AbilityType.SKULL_SPLIITER); - Skills.watchCooldown(player, PP, curTime, AbilityType.GIGA_DRILL_BREAKER); - Skills.watchCooldown(player, PP, curTime, AbilityType.GREEN_TERRA); - Skills.watchCooldown(player, PP, curTime, AbilityType.SUPER_BREAKER); - Skills.watchCooldown(player, PP, curTime, AbilityType.SERRATED_STRIKES); - Skills.watchCooldown(player, PP, curTime, AbilityType.BERSERK); - Skills.watchCooldown(player, PP, curTime, AbilityType.TREE_FELLER); - Skills.watchCooldown(player, PP, curTime, AbilityType.BLAST_MINING); + for (AbilityType ability : AbilityType.values()) { + if (ability.getCooldown() > 0 ) { + Skills.watchCooldown(player, PP, curTime, ability); + } + } } } } diff --git a/src/main/java/com/gmail/nossr50/skills/Acrobatics.java b/src/main/java/com/gmail/nossr50/skills/Acrobatics.java index 205c2ebd5..f116fd207 100644 --- a/src/main/java/com/gmail/nossr50/skills/Acrobatics.java +++ b/src/main/java/com/gmail/nossr50/skills/Acrobatics.java @@ -68,10 +68,10 @@ public class Acrobatics { } if (gracefulRoll) { - player.sendMessage(mcLocale.getString("Acrobatics.GracefulRoll")); + player.sendMessage(mcLocale.getString("Acrobatics.Ability.Proc")); } else { - player.sendMessage(mcLocale.getString("Acrobatics.Roll")); + player.sendMessage(mcLocale.getString("Acrobatics.Roll.Text")); } } } @@ -108,7 +108,7 @@ public class Acrobatics { int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL); if (random.nextInt(4000) <= skillCheck && mcPermissions.getInstance().dodge(defender)) { - defender.sendMessage(mcLocale.getString("Acrobatics.Dodge")); + defender.sendMessage(mcLocale.getString("Acrobatics.Combat.Proc")); if (System.currentTimeMillis() >= (5000 + PPd.getRespawnATS()) && defender.getHealth() >= 1) { PPd.addXP(SkillType.ACROBATICS, damage * DODGE_MODIFIER); diff --git a/src/main/java/com/gmail/nossr50/skills/Axes.java b/src/main/java/com/gmail/nossr50/skills/Axes.java index 57ba9be4d..3fa1fd74c 100644 --- a/src/main/java/com/gmail/nossr50/skills/Axes.java +++ b/src/main/java/com/gmail/nossr50/skills/Axes.java @@ -80,12 +80,12 @@ public class Axes { if (entity instanceof Player){ event.setDamage((int) (damage * PVP_MODIFIER)); Player player = (Player) entity; - player.sendMessage(mcLocale.getString("Axes.HitCritically")); + player.sendMessage(mcLocale.getString("Axes.Combat.CritStruck")); } else { event.setDamage(damage * PVE_MODIFIER); } - attacker.sendMessage(mcLocale.getString("Axes.CriticalHit")); + attacker.sendMessage(mcLocale.getString("Axes.Combat.CriticalHit")); } } @@ -138,7 +138,7 @@ public class Axes { if (random.nextInt(100) <= GREATER_IMPACT_CHANCE) { event.setDamage(event.getDamage() + 2); target.setVelocity(attacker.getLocation().getDirection().normalize().multiply(GREATER_IMPACT_MULTIPLIER)); - attacker.sendMessage(mcLocale.getString("Axes.GreaterImpactOnEnemy")); + attacker.sendMessage(mcLocale.getString("Axes.Combat.GI.Proc")); } } diff --git a/src/main/java/com/gmail/nossr50/skills/BlastMining.java b/src/main/java/com/gmail/nossr50/skills/BlastMining.java index 01964c272..a8bc7f6c8 100644 --- a/src/main/java/com/gmail/nossr50/skills/BlastMining.java +++ b/src/main/java/com/gmail/nossr50/skills/BlastMining.java @@ -273,7 +273,7 @@ public class BlastMining { } } - player.sendMessage(mcLocale.getString("BlastMining.Boom")); + player.sendMessage(mcLocale.getString("Mining.Blast.Boom")); /* Create the TNT entity */ TNTPrimed tnt = player.getWorld().spawn(block.getLocation(), TNTPrimed.class); diff --git a/src/main/java/com/gmail/nossr50/skills/Fishing.java b/src/main/java/com/gmail/nossr50/skills/Fishing.java index a74c5e82f..53db35733 100644 --- a/src/main/java/com/gmail/nossr50/skills/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/Fishing.java @@ -97,14 +97,12 @@ public class Fishing { break; } - if (LoadProperties.fishingDrops) { - if (rewards.size() > 0) { - FishingTreasure treasure = rewards.get(random.nextInt(rewards.size())); + if (LoadProperties.fishingDrops && rewards.size() > 0) { + FishingTreasure treasure = rewards.get(random.nextInt(rewards.size())); - if (random.nextDouble() * 100 <= treasure.getDropChance()) { - Users.getProfile(player).addXP(SkillType.FISHING, treasure.getXp()); - theCatch.setItemStack(treasure.getDrop()); - } + if (random.nextDouble() * 100 <= treasure.getDropChance()) { + Users.getProfile(player).addXP(SkillType.FISHING, treasure.getXp()); + theCatch.setItemStack(treasure.getDrop()); } } else { diff --git a/src/main/java/com/gmail/nossr50/skills/Repair.java b/src/main/java/com/gmail/nossr50/skills/Repair.java index 9904a6fae..0c8a25925 100644 --- a/src/main/java/com/gmail/nossr50/skills/Repair.java +++ b/src/main/java/com/gmail/nossr50/skills/Repair.java @@ -103,7 +103,7 @@ public class Repair { } } else { - player.sendMessage(mcLocale.getString("Skills.FullDurability")); + player.sendMessage(mcLocale.getString("Repair.Skills.FullDurability")); } } @@ -190,7 +190,7 @@ public class Repair { for (Enchantment x : enchants.keySet()) { is.removeEnchantment(x); } - player.sendMessage(mcLocale.getString("Repair.LostEnchants")); + player.sendMessage(mcLocale.getString("Repair.Arcane.Lost")); return; } @@ -217,13 +217,13 @@ public class Repair { Map newEnchants = is.getEnchantments(); if (newEnchants.isEmpty()) { - player.sendMessage(mcLocale.getString("Repair.ArcaneFailed")); + player.sendMessage(mcLocale.getString("Repair.Arcane.Fail")); } else if (downgraded || newEnchants.size() < enchants.size()) { - player.sendMessage(mcLocale.getString("Repair.Downgraded")); + player.sendMessage(mcLocale.getString("Repair.Arcane.Downgrade")); } else { - player.sendMessage(mcLocale.getString("Repair.ArcanePerfect")); + player.sendMessage(mcLocale.getString("Repair.Arcane.Perfect")); } } @@ -350,12 +350,12 @@ public class Repair { int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR); if (is.getAmount() != 1) { - player.sendMessage(mcLocale.getString("Skills.StackedItems")); + player.sendMessage(mcLocale.getString("Repair.Skills.StackedItems")); } else { if (ItemChecks.isDiamondTool(is) || ItemChecks.isDiamondArmor(is)) { if (skillLevel < LoadProperties.repairDiamondLevel) { - player.sendMessage(mcLocale.getString("Skills.AdeptDiamond")); + player.sendMessage(mcLocale.getString("Repair.Skills.AdeptDiamond")); } else { player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.BLUE + m.prettyItemString(LoadProperties.rDiamond)); @@ -363,7 +363,7 @@ public class Repair { } else if (ItemChecks.isIronTool(is) || ItemChecks.isIronArmor(is)) { if (skillLevel < LoadProperties.repairIronLevel) { - player.sendMessage(mcLocale.getString("Skills.AdeptIron")); + player.sendMessage(mcLocale.getString("Repair.Skills.AdeptIron")); } else { player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(LoadProperties.rIron)); @@ -371,7 +371,7 @@ public class Repair { } else if (ItemChecks.isGoldTool(is) || ItemChecks.isGoldArmor(is)) { if (skillLevel < LoadProperties.repairGoldLevel) { - player.sendMessage(mcLocale.getString("Skills.AdeptGold")); + player.sendMessage(mcLocale.getString("Repair.Skills.AdeptGold")); } else { player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.GOLD + m.prettyItemString(LoadProperties.rGold)); @@ -379,7 +379,7 @@ public class Repair { } else if (ItemChecks.isStoneTool(is)) { if (skillLevel < LoadProperties.repairStoneLevel) { - player.sendMessage(mcLocale.getString("Skills.AdeptStone")); + player.sendMessage(mcLocale.getString("Repair.Skills.AdeptStone")); } else { player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.GRAY + m.prettyItemString(LoadProperties.rStone)); @@ -409,7 +409,7 @@ public class Repair { int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR); if ((skillLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= skillLevel) && mcPermissions.getInstance().repairBonus(player)) { - player.sendMessage(mcLocale.getString("Skills.FeltEasy")); + player.sendMessage(mcLocale.getString("Repair.Skills.FeltEasy")); return true; } @@ -468,7 +468,7 @@ public class Repair { } } else { - player.sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil")); + player.sendMessage(mcLocale.getString("Repair.Listener.Anvil")); } PP.togglePlacedAnvil(); diff --git a/src/main/java/com/gmail/nossr50/skills/Skills.java b/src/main/java/com/gmail/nossr50/skills/Skills.java index 0391de661..dd1b15d91 100644 --- a/src/main/java/com/gmail/nossr50/skills/Skills.java +++ b/src/main/java/com/gmail/nossr50/skills/Skills.java @@ -220,16 +220,16 @@ public class Skills { SpoutStuff.levelUpNotification(skillType, sPlayer); /* Update custom titles */ - if(LoadProperties.showPowerLevel) { + if (LoadProperties.showPowerLevel) { sPlayer.setTitle(sPlayer.getName()+ "\n" + ChatColor.YELLOW + "P" + ChatColor.GOLD + "lvl" + ChatColor.WHITE + "." + ChatColor.GREEN + String.valueOf(PP.getPowerLevel())); } } else { - player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)})); + player.sendMessage(mcLocale.getString(capitalized + "Skillup", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)})); } } else { - player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)})); + player.sendMessage(mcLocale.getString(capitalized + "Skillup", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)})); } } diff --git a/src/main/java/com/gmail/nossr50/skills/Swords.java b/src/main/java/com/gmail/nossr50/skills/Swords.java index c68a1fc48..d23894cf5 100644 --- a/src/main/java/com/gmail/nossr50/skills/Swords.java +++ b/src/main/java/com/gmail/nossr50/skills/Swords.java @@ -73,7 +73,7 @@ public class Swords { else { mcBleedTimer.add(entity); } - attacker.sendMessage(mcLocale.getString("Swords.EnemyBleeding")); + attacker.sendMessage(mcLocale.getString("Swords.Combat.Bleeding")); } } @@ -104,10 +104,10 @@ public class Swords { if (random.nextInt(2000) <= skillCheck) { Combat.dealDamage((LivingEntity) attacker, event.getDamage() / COUNTER_ATTACK_MODIFIER); - defender.sendMessage(mcLocale.getString("Swords.CounterAttacked")); + defender.sendMessage(mcLocale.getString("Swords.Combat.Countered")); if (attacker instanceof Player) { - ((Player) attacker).sendMessage(mcLocale.getString("Swords.HitByCounterAttack")); + ((Player) attacker).sendMessage(mcLocale.getString("Swords.Combat.Counter.Hit")); } } } diff --git a/src/main/java/com/gmail/nossr50/skills/Taming.java b/src/main/java/com/gmail/nossr50/skills/Taming.java index 24c762916..c809dcdf8 100644 --- a/src/main/java/com/gmail/nossr50/skills/Taming.java +++ b/src/main/java/com/gmail/nossr50/skills/Taming.java @@ -154,7 +154,7 @@ public class Taming { } wolf.teleport(master.getLocation()); - master.sendMessage(mcLocale.getString("mcEntityListener.WolfComesBack")); + master.sendMessage(mcLocale.getString("Taming.Listener.Wolf")); } } break; @@ -232,11 +232,11 @@ public class Taming { if (x.getType().equals(type)) { switch (type) { case WOLF: - player.sendMessage(mcLocale.getString("m.TamingSummonWolfFailed")); + player.sendMessage(mcLocale.getString("Taming.Summon.Fail.Wolf")); return; case OCELOT: - player.sendMessage(mcLocale.getString("m.TamingSummonOcelotFailed")); + player.sendMessage(mcLocale.getString("Taming.Summon.Fail.Ocelot")); return; default: @@ -258,7 +258,7 @@ public class Taming { } player.setItemInHand(new ItemStack(summonItem, item.getAmount() - summonAmount)); - player.sendMessage(mcLocale.getString("m.TamingSummon")); + player.sendMessage(mcLocale.getString("Taming.Summon.Complete")); } else { player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(summonItem.getId())); diff --git a/src/main/java/com/gmail/nossr50/skills/WoodCutting.java b/src/main/java/com/gmail/nossr50/skills/WoodCutting.java index 78f74e16a..dfdd2cea0 100644 --- a/src/main/java/com/gmail/nossr50/skills/WoodCutting.java +++ b/src/main/java/com/gmail/nossr50/skills/WoodCutting.java @@ -54,7 +54,7 @@ public class WoodCutting { */ private static void removeBlocks(ArrayList toBeFelled, Player player, PlayerProfile PP) { if (toBeFelled.size() >= LoadProperties.treeFellerThreshold) { - player.sendMessage(mcLocale.getString("Skills.Woodcutting.TreeFellerThreshold")); + player.sendMessage(mcLocale.getString("Woodcutting.Skills.TreeFellerThreshold")); return; } @@ -67,7 +67,7 @@ public class WoodCutting { /* This is to prevent using wood axes everytime you tree fell */ if ((inHand.getDurability() + durabilityLoss >= inHand.getType().getMaxDurability()) || inHand.getType().equals(Material.AIR)) { - player.sendMessage(mcLocale.getString("TreeFeller.AxeSplinters")); + player.sendMessage(mcLocale.getString("Woodcutting.Skills.TreeFeller.Splinter")); int health = player.getHealth(); diff --git a/src/main/resources/locale/locale_en_us.properties b/src/main/resources/locale/locale_en_us.properties index e2bace565..6b31c394b 100644 --- a/src/main/resources/locale/locale_en_us.properties +++ b/src/main/resources/locale/locale_en_us.properties @@ -128,9 +128,9 @@ Herbalism.Ability.8=Double Drops (All Herbs) Herbalism.Ability.9=Double the normal loot Herbalism.Ability.DoubleDropChance=[[RED]]Double Drop Chance: [[YELLOW]]{0}% Herbalism.Ability.FD=[[RED]]Farmers Diet: [[YELLOW]]Rank {0} +Herbalism.Ability.GTe.Length=[[RED]]Green Terra Length: [[YELLOW]]{0}s Herbalism.Ability.GTh.Chance=[[RED]]Green Thumb Chance: [[YELLOW]]{0}% Herbalism.Ability.GTh.Fail=[[RED]]**GREEN THUMB FAIL** -Herbalism.Ability.GTh.Length=[[RED]]Green Terra Length: [[YELLOW]]{0}s Herbalism.Ability.GTh.Stage=[[RED]]Green Thumb Stage: [[YELLOW]] Wheat grows in stage {0} Herbalism.Ability.GTh=[[GREEN]]**GREEN THUMB** Herbalism.Ability.Lower=[[GRAY]]**YOU LOWER YOUR HOE** diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 4221145f9..397b0492b 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -31,113 +31,86 @@ commands: addxp: aliases: [] description: Add XP to a user - permission: mcmmo.tools.mmoedit addlevels: aliases: [] description: Add levels to a user - permission: mcmmo.tools.mmoedit mcability: aliases: [] description: Toggle whether or not abilities get readied on right click - permission: mcmmo.commands.ability mcrefresh: aliases: [] description: Refresh all cooldowns for mcMMO - permission: mcmmo.tools.mcrefresh mcgod: aliases: [] description: Make yourself invulnerable - permission: mcmmo.tools.mcgod mcstats: aliases: [] description: Shows your mcMMO stats and xp mcremove: aliases: [] description: Remove a user from the database - permission: mcmmo.tools.mcremove mmoedit: aliases: [] description: Edit the skill values for a user - permission: mcmmo.tools.mmoedit ptp: aliases: [] description: Teleport to a party member - permission: mcmmo.commands.ptp party: aliases: [] description: Create/join a party - permission: mcmmo.commands.party inspect: aliases: [] - description: View mcMMO stats of another player invite: aliases: [] description: Invite a player into your party - permission: mcmmo.chat.partychat accept: aliases: [] description: Accept a party invite - permission: mcmmo.chat.partychat mmoupdate: aliases: [] description: Convert from Flat File to MySQL - permission: mcmmo.admin p: aliases: [pc] description: Toggle Party chat or send party chat messages - permission: mcmmo.chat.partychat excavation: aliases: [] description: Detailed skill info - permission: mcmmo.skills.excavation herbalism: aliases: [] description: Detailed skill info - permission: mcmmo.skills.herbalism mining: aliases: [] description: Detailed skill info - permission: mcmmo.skills.mining woodcutting: aliases: [] description: Detailed skill info - permission: mcmmo.skills.woodcutting axes: aliases: [] description: Detailed skill info - permission: mcmmo.skills.axes archery: aliases: [] description: Detailed skill info - permission: mcmmo.skills.archery swords: aliases: [] description: Detailed skill info - permission: mcmmo.skills.swords taming: aliases: [] description: Detailed skill info - permission: mcmmo.skills.taming unarmed: aliases: [] description: Detailed skill info - permission: mcmmo.skills.unarmed acrobatics: aliases: [] description: Detailed skill info - permission: mcmmo.skills.acrobatics repair: - aliases: [] + aliases: [mcrepair] description: Detailed skill info - permission: mcmmo.skills.repair fishing: aliases: [] description: Detailed skill info - permission: mcmmo.skills.fishing a: aliases: [ac] description: Toggle Admin chat or send admin chat messages - permission: mcmmo.chat.adminchat permissions: mcmmo.*: description: Implies all mcmmo permissions. @@ -165,7 +138,7 @@ permissions: mcmmo.admin: true mcmmo.tools.*: true mcmmo.admin: - description: All ows access to mmoupdate and other sensitive commands + description: Allows access to mmoupdate and other sensitive commands mcmmo.bypass.arcanebypass: description: Allows user to bypass Arcane Repair so he will never lose enchantments mcmmo.tools.*: