From caf9c07ba3d3d85180932596260c90a9b54efe08 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 3 Jul 2012 10:04:04 -0400 Subject: [PATCH] Because PP is an awful variable name. --- .../gmail/nossr50/commands/CommandHelper.java | 30 ++++----- .../commands/general/AddlevelsCommand.java | 10 +-- .../commands/general/InspectCommand.java | 32 +++++----- .../commands/general/McstatsCommand.java | 4 +- .../nossr50/commands/mc/McabilityCommand.java | 6 +- .../nossr50/commands/mc/McgodCommand.java | 6 +- .../nossr50/commands/mc/McrefreshCommand.java | 16 ++--- .../nossr50/commands/party/ACommand.java | 12 ++-- .../nossr50/commands/party/PCommand.java | 12 ++-- .../nossr50/commands/party/PtpCommand.java | 6 +- .../nossr50/listeners/BlockListener.java | 36 +++++------ .../nossr50/listeners/EntityListener.java | 14 ++--- .../nossr50/listeners/PlayerListener.java | 18 +++--- .../com/gmail/nossr50/runnables/GainXp.java | 8 +-- .../nossr50/runnables/GreenThumbTimer.java | 14 ++--- .../gmail/nossr50/runnables/SkillMonitor.java | 6 +- .../com/gmail/nossr50/skills/combat/Axes.java | 4 +- .../nossr50/skills/gathering/BlastMining.java | 12 ++-- .../nossr50/skills/gathering/Excavation.java | 6 +- .../nossr50/skills/gathering/Fishing.java | 16 ++--- .../nossr50/skills/gathering/Herbalism.java | 18 +++--- .../nossr50/skills/gathering/Mining.java | 4 +- .../nossr50/skills/gathering/WoodCutting.java | 14 ++--- .../gmail/nossr50/skills/repair/Repair.java | 18 +++--- .../skills/repair/SimpleRepairManager.java | 6 +- .../com/gmail/nossr50/spout/SpoutStuff.java | 6 +- .../java/com/gmail/nossr50/util/Combat.java | 24 +++---- .../java/com/gmail/nossr50/util/Item.java | 8 +-- .../java/com/gmail/nossr50/util/Skills.java | 62 +++++++++---------- 29 files changed, 214 insertions(+), 214 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/CommandHelper.java b/src/main/java/com/gmail/nossr50/commands/CommandHelper.java index 143fca68e..46516d8b8 100644 --- a/src/main/java/com/gmail/nossr50/commands/CommandHelper.java +++ b/src/main/java/com/gmail/nossr50/commands/CommandHelper.java @@ -49,28 +49,28 @@ public class CommandHelper { */ public static void printGatheringSkills(Player inspect, CommandSender display) { if (Skills.hasGatheringSkills(inspect)) { - PlayerProfile PP = Users.getProfile(inspect); + PlayerProfile profile = Users.getProfile(inspect); display.sendMessage(LocaleLoader.getString("Stats.Header.Gathering")); if (Permissions.getInstance().excavation(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Excavation.Listener"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Excavation.Listener"), profile.getSkillLevel(SkillType.EXCAVATION), profile.getSkillXpLevel(SkillType.EXCAVATION), profile.getXpToLevel(SkillType.EXCAVATION) })); } if (Permissions.getInstance().fishing(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Fishing.Listener"), PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Fishing.Listener"), profile.getSkillLevel(SkillType.FISHING), profile.getSkillXpLevel(SkillType.FISHING), profile.getXpToLevel(SkillType.FISHING) })); } if (Permissions.getInstance().herbalism(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Herbalism.Listener"), PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Herbalism.Listener"), profile.getSkillLevel(SkillType.HERBALISM), profile.getSkillXpLevel(SkillType.HERBALISM), profile.getXpToLevel(SkillType.HERBALISM) })); } if (Permissions.getInstance().mining(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Mining.Listener"), PP.getSkillLevel(SkillType.MINING), PP.getSkillXpLevel(SkillType.MINING), PP.getXpToLevel(SkillType.MINING) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Mining.Listener"), profile.getSkillLevel(SkillType.MINING), profile.getSkillXpLevel(SkillType.MINING), profile.getXpToLevel(SkillType.MINING) })); } if (Permissions.getInstance().woodcutting(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Woodcutting.Listener"), PP.getSkillLevel(SkillType.WOODCUTTING), PP.getSkillXpLevel(SkillType.WOODCUTTING), PP.getXpToLevel(SkillType.WOODCUTTING) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Woodcutting.Listener"), profile.getSkillLevel(SkillType.WOODCUTTING), profile.getSkillXpLevel(SkillType.WOODCUTTING), profile.getXpToLevel(SkillType.WOODCUTTING) })); } } } @@ -87,28 +87,28 @@ public class CommandHelper { */ public static void printCombatSkills(Player inspect, CommandSender display) { if (Skills.hasCombatSkills(inspect)) { - PlayerProfile PP = Users.getProfile(inspect); + PlayerProfile profile = Users.getProfile(inspect); display.sendMessage(LocaleLoader.getString("Stats.Header.Combat")); if (Permissions.getInstance().axes(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Axes.Listener"), PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Axes.Listener"), profile.getSkillLevel(SkillType.AXES), profile.getSkillXpLevel(SkillType.AXES), profile.getXpToLevel(SkillType.AXES) })); } if (Permissions.getInstance().archery(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Archery.Listener"), PP.getSkillLevel(SkillType.ARCHERY), PP.getSkillXpLevel(SkillType.ARCHERY), PP.getXpToLevel(SkillType.ARCHERY) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Archery.Listener"), profile.getSkillLevel(SkillType.ARCHERY), profile.getSkillXpLevel(SkillType.ARCHERY), profile.getXpToLevel(SkillType.ARCHERY) })); } if (Permissions.getInstance().swords(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Swords.Listener"), PP.getSkillLevel(SkillType.SWORDS), PP.getSkillXpLevel(SkillType.SWORDS), PP.getXpToLevel(SkillType.SWORDS) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Swords.Listener"), profile.getSkillLevel(SkillType.SWORDS), profile.getSkillXpLevel(SkillType.SWORDS), profile.getXpToLevel(SkillType.SWORDS) })); } if (Permissions.getInstance().taming(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Taming.Listener"), PP.getSkillLevel(SkillType.TAMING), PP.getSkillXpLevel(SkillType.TAMING), PP.getXpToLevel(SkillType.TAMING) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Taming.Listener"), profile.getSkillLevel(SkillType.TAMING), profile.getSkillXpLevel(SkillType.TAMING), profile.getXpToLevel(SkillType.TAMING) })); } if (Permissions.getInstance().unarmed(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Unarmed.Listener"), PP.getSkillLevel(SkillType.UNARMED), PP.getSkillXpLevel(SkillType.UNARMED), PP.getXpToLevel(SkillType.UNARMED) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Unarmed.Listener"), profile.getSkillLevel(SkillType.UNARMED), profile.getSkillXpLevel(SkillType.UNARMED), profile.getXpToLevel(SkillType.UNARMED) })); } } } @@ -125,15 +125,15 @@ public class CommandHelper { */ public static void printMiscSkills(Player inspect, CommandSender display) { if (Skills.hasMiscSkills(inspect)) { - PlayerProfile PP = Users.getProfile(inspect); + PlayerProfile profile = Users.getProfile(inspect); display.sendMessage(LocaleLoader.getString("Stats.Header.Misc")); if (Permissions.getInstance().acrobatics(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Acrobatics.Listener"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Acrobatics.Listener"), profile.getSkillLevel(SkillType.ACROBATICS), profile.getSkillXpLevel(SkillType.ACROBATICS), profile.getXpToLevel(SkillType.ACROBATICS) })); } if (Permissions.getInstance().repair(inspect)) { - display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Repair.Listener"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) })); + display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Repair.Listener"), profile.getSkillLevel(SkillType.REPAIR), profile.getSkillXpLevel(SkillType.REPAIR), profile.getXpToLevel(SkillType.REPAIR) })); } } } diff --git a/src/main/java/com/gmail/nossr50/commands/general/AddlevelsCommand.java b/src/main/java/com/gmail/nossr50/commands/general/AddlevelsCommand.java index 062b48443..6443b35a1 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/AddlevelsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/AddlevelsCommand.java @@ -26,7 +26,7 @@ public class AddlevelsCommand implements CommandExecutor{ @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { OfflinePlayer modifiedPlayer; - PlayerProfile PP; + PlayerProfile profile; int levels; SkillType skill; String skillName; @@ -48,7 +48,7 @@ public class AddlevelsCommand implements CommandExecutor{ modifiedPlayer = (Player) sender; levels = Integer.valueOf(args[1]); skill = Skills.getSkillType(args[0]); - PP = Users.getProfile(modifiedPlayer); + profile = Users.getProfile(modifiedPlayer); if (skill.equals(SkillType.ALL)) { skillName = "all skills"; @@ -57,7 +57,7 @@ public class AddlevelsCommand implements CommandExecutor{ skillName = Misc.getCapitalized(skill.toString()); } - PP.addLevels(skill, levels); + profile.addLevels(skill, levels); sender.sendMessage(ChatColor.GREEN + "You were awarded " + levels + " levels in " + skillName + "!"); //TODO: Needs more locale. } } @@ -70,9 +70,9 @@ public class AddlevelsCommand implements CommandExecutor{ case 3: modifiedPlayer = plugin.getServer().getOfflinePlayer(args[0]); String playerName = modifiedPlayer.getName(); - PP = Users.getProfile(modifiedPlayer); + profile = Users.getProfile(modifiedPlayer); - if (!PP.isLoaded()) { + if (!profile.isLoaded()) { sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist")); return true; } 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 b3bd81f13..4ffb3c3aa 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java @@ -25,7 +25,7 @@ public class InspectCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { OfflinePlayer target; - PlayerProfile PP; + PlayerProfile profile; String usage = "Proper usage is /inspect "; //TODO: Needs more locale. if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.inspect")) { @@ -35,7 +35,7 @@ public class InspectCommand implements CommandExecutor { switch (args.length) { case 1: target = plugin.getServer().getOfflinePlayer(args[0]); - PP = Users.getProfile(target); + profile = Users.getProfile(target); if (target.isOnline()) { Player player = (Player) target; @@ -49,7 +49,7 @@ public class InspectCommand implements CommandExecutor { CommandHelper.printGatheringSkills(player, sender); CommandHelper.printCombatSkills(player, sender); CommandHelper.printMiscSkills(player, sender); - sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", new Object[] { PP.getPowerLevel() })); + sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", new Object[] { profile.getPowerLevel() })); return true; } @@ -59,7 +59,7 @@ public class InspectCommand implements CommandExecutor { return true; } - if (!PP.isLoaded()) { + if (!profile.isLoaded()) { sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist")); return true; } @@ -67,22 +67,22 @@ public class InspectCommand implements CommandExecutor { sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", new Object[] { args[0] })); sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering")); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Excavation.Listener"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) })); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Fishing.Listener"), PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) })); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Herbalism.Listener"), PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) })); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Mining.Listener"), PP.getSkillLevel(SkillType.MINING), PP.getSkillXpLevel(SkillType.MINING), PP.getXpToLevel(SkillType.MINING) })); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Woodcutting.Listener"), PP.getSkillLevel(SkillType.WOODCUTTING), PP.getSkillXpLevel(SkillType.WOODCUTTING), PP.getXpToLevel(SkillType.WOODCUTTING) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Excavation.Listener"), profile.getSkillLevel(SkillType.EXCAVATION), profile.getSkillXpLevel(SkillType.EXCAVATION), profile.getXpToLevel(SkillType.EXCAVATION) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Fishing.Listener"), profile.getSkillLevel(SkillType.FISHING), profile.getSkillXpLevel(SkillType.FISHING), profile.getXpToLevel(SkillType.FISHING) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Herbalism.Listener"), profile.getSkillLevel(SkillType.HERBALISM), profile.getSkillXpLevel(SkillType.HERBALISM), profile.getXpToLevel(SkillType.HERBALISM) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Mining.Listener"), profile.getSkillLevel(SkillType.MINING), profile.getSkillXpLevel(SkillType.MINING), profile.getXpToLevel(SkillType.MINING) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Woodcutting.Listener"), profile.getSkillLevel(SkillType.WOODCUTTING), profile.getSkillXpLevel(SkillType.WOODCUTTING), profile.getXpToLevel(SkillType.WOODCUTTING) })); sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat")); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Axes.Listener"), PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES) })); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Archery.Listener"), PP.getSkillLevel(SkillType.ARCHERY), PP.getSkillXpLevel(SkillType.ARCHERY), PP.getXpToLevel(SkillType.ARCHERY) })); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Swords.Listener"), PP.getSkillLevel(SkillType.SWORDS), PP.getSkillXpLevel(SkillType.SWORDS), PP.getXpToLevel(SkillType.SWORDS) })); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Taming.Listener"), PP.getSkillLevel(SkillType.TAMING), PP.getSkillXpLevel(SkillType.TAMING), PP.getXpToLevel(SkillType.TAMING) })); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Unarmed.Listener"), PP.getSkillLevel(SkillType.UNARMED), PP.getSkillXpLevel(SkillType.UNARMED), PP.getXpToLevel(SkillType.UNARMED) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Axes.Listener"), profile.getSkillLevel(SkillType.AXES), profile.getSkillXpLevel(SkillType.AXES), profile.getXpToLevel(SkillType.AXES) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Archery.Listener"), profile.getSkillLevel(SkillType.ARCHERY), profile.getSkillXpLevel(SkillType.ARCHERY), profile.getXpToLevel(SkillType.ARCHERY) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Swords.Listener"), profile.getSkillLevel(SkillType.SWORDS), profile.getSkillXpLevel(SkillType.SWORDS), profile.getXpToLevel(SkillType.SWORDS) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Taming.Listener"), profile.getSkillLevel(SkillType.TAMING), profile.getSkillXpLevel(SkillType.TAMING), profile.getXpToLevel(SkillType.TAMING) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Unarmed.Listener"), profile.getSkillLevel(SkillType.UNARMED), profile.getSkillXpLevel(SkillType.UNARMED), profile.getXpToLevel(SkillType.UNARMED) })); sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc")); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Acrobatics.Listener"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS) })); - sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Repair.Listener"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Acrobatics.Listener"), profile.getSkillLevel(SkillType.ACROBATICS), profile.getSkillXpLevel(SkillType.ACROBATICS), profile.getXpToLevel(SkillType.ACROBATICS) })); + sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Repair.Listener"), profile.getSkillLevel(SkillType.REPAIR), profile.getSkillXpLevel(SkillType.REPAIR), profile.getXpToLevel(SkillType.REPAIR) })); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/general/McstatsCommand.java b/src/main/java/com/gmail/nossr50/commands/general/McstatsCommand.java index ddf00ecaa..88959cc51 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/McstatsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/McstatsCommand.java @@ -19,7 +19,7 @@ public class McstatsCommand implements CommandExecutor { } Player player = (Player) sender; - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); player.sendMessage(LocaleLoader.getString("Stats.Own.Stats")); player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote")); @@ -28,7 +28,7 @@ public class McstatsCommand implements CommandExecutor { CommandHelper.printCombatSkills(player); CommandHelper.printMiscSkills(player); - player.sendMessage(LocaleLoader.getString("Commands.PowerLevel", new Object[] { String.valueOf(PP.getPowerLevel()) })); + player.sendMessage(LocaleLoader.getString("Commands.PowerLevel", new Object[] { String.valueOf(profile.getPowerLevel()) })); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McabilityCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McabilityCommand.java index 3d5739b18..b91e32abe 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McabilityCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McabilityCommand.java @@ -22,16 +22,16 @@ public class McabilityCommand implements CommandExecutor { return true; } - PlayerProfile PP = Users.getProfile((Player) sender); + PlayerProfile profile = Users.getProfile((Player) sender); - if (PP.getAbilityUse()) { + if (profile.getAbilityUse()) { sender.sendMessage(LocaleLoader.getString("Commands.Ability.Off")); } else { sender.sendMessage(LocaleLoader.getString("Commands.Ability.On")); } - PP.toggleAbilityUse(); + profile.toggleAbilityUse(); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McgodCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McgodCommand.java index 6aca2cc23..572414499 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McgodCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McgodCommand.java @@ -22,16 +22,16 @@ public class McgodCommand implements CommandExecutor { return true; } - PlayerProfile PP = Users.getProfile((Player) sender); + PlayerProfile profile = Users.getProfile((Player) sender); - if (PP.getGodMode()) { + if (profile.getGodMode()) { sender.sendMessage(LocaleLoader.getString("Commands.GodMode.Disabled")); } else { sender.sendMessage(LocaleLoader.getString("Commands.GodMode.Enabled")); } - PP.toggleGodMode(); + profile.toggleGodMode(); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McrefreshCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McrefreshCommand.java index fd460cbcd..efc9ce4f3 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McrefreshCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McrefreshCommand.java @@ -23,7 +23,7 @@ public class McrefreshCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { OfflinePlayer player; - PlayerProfile PP; + PlayerProfile profile; String usage = ChatColor.RED + "Proper usage is /mcrefresh [player]"; //TODO: Needs more locale if (CommandHelper.noCommandPermissions(sender, "mcmmo.tools.mcrefresh")) { @@ -34,7 +34,7 @@ public class McrefreshCommand implements CommandExecutor { case 0: if (sender instanceof Player) { player = (Player) sender; - PP = Users.getProfile(player); + profile = Users.getProfile(player); } else { sender.sendMessage(usage); @@ -44,10 +44,10 @@ public class McrefreshCommand implements CommandExecutor { case 1: player = plugin.getServer().getOfflinePlayer(args[0]); - PP = Users.getProfile(player); + profile = Users.getProfile(player); String playerName = player.getName(); - if (!PP.isLoaded()) { + if (!profile.isLoaded()) { sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist")); return true; } @@ -61,10 +61,10 @@ public class McrefreshCommand implements CommandExecutor { return true; } - PP.setRecentlyHurt(0); - PP.resetCooldowns(); - PP.resetToolPrepMode(); - PP.resetAbilityMode(); + profile.setRecentlyHurt(0); + profile.resetCooldowns(); + profile.resetToolPrepMode(); + profile.resetAbilityMode(); if (player.isOnline()) { ((Player) player).sendMessage(LocaleLoader.getString("Ability.Generic.Refresh")); diff --git a/src/main/java/com/gmail/nossr50/commands/party/ACommand.java b/src/main/java/com/gmail/nossr50/commands/party/ACommand.java index 726c2658a..745d91112 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/ACommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/ACommand.java @@ -23,7 +23,7 @@ public class ACommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - PlayerProfile PP; + PlayerProfile profile; String usage = ChatColor.RED + "Proper usage is /a "; //TODO: Needs more locale. if (CommandHelper.noCommandPermissions(sender, "mcmmo.chat.adminchat")) { @@ -33,15 +33,15 @@ public class ACommand implements CommandExecutor { switch (args.length) { case 0: if (sender instanceof Player) { - PP = Users.getProfile((Player) sender); + profile = Users.getProfile((Player) sender); - if (PP.getPartyChatMode()) { - PP.togglePartyChat(); + if (profile.getPartyChatMode()) { + profile.togglePartyChat(); } - PP.toggleAdminChat(); + profile.toggleAdminChat(); - if (PP.getAdminChatMode()) { + if (profile.getAdminChatMode()) { sender.sendMessage(LocaleLoader.getString("Commands.AdminChat.On")); } else { diff --git a/src/main/java/com/gmail/nossr50/commands/party/PCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PCommand.java index 794878a72..19ab6a7b5 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PCommand.java @@ -24,7 +24,7 @@ public class PCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - PlayerProfile PP; + PlayerProfile profile; String usage = ChatColor.RED + "Proper usage is /p "; //TODO: Needs more locale. if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.party")) { @@ -34,15 +34,15 @@ public class PCommand implements CommandExecutor { switch (args.length) { case 0: if (sender instanceof Player) { - PP = Users.getProfile((Player) sender); + profile = Users.getProfile((Player) sender); - if (PP.getAdminChatMode()) { - PP.toggleAdminChat(); + if (profile.getAdminChatMode()) { + profile.toggleAdminChat(); } - PP.togglePartyChat(); + profile.togglePartyChat(); - if (PP.getPartyChatMode()) { + if (profile.getPartyChatMode()) { sender.sendMessage(LocaleLoader.getString("Commands.Party.Chat.On")); } else { diff --git a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java index 108cc6010..9136fb4aa 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java @@ -37,9 +37,9 @@ public class PtpCommand implements CommandExecutor { switch (args.length) { case 1: Player player = (Player) sender; - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); - if (PP.getRecentlyHurt() + (Config.getInstance().getPTPCommandCooldown() * 1000) > System.currentTimeMillis()) { + if (profile.getRecentlyHurt() + (Config.getInstance().getPTPCommandCooldown() * 1000) > System.currentTimeMillis()) { player.sendMessage(LocaleLoader.getString("Party.Teleport.Hurt", new Object[] { Config.getInstance().getPTPCommandCooldown() })); return true; } @@ -62,7 +62,7 @@ public class PtpCommand implements CommandExecutor { } if (PartyManager.getInstance().inSameParty(player, target)) { - McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(player, target, PP.getParty().getName()); + McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(player, target, profile.getParty().getName()); plugin.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index b41505e1e..d952f3dca 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -158,9 +158,9 @@ public class BlockListener implements Listener { } Player player = event.getPlayer(); - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); - if (PP == null) { + if (profile == null) { return; } @@ -173,12 +173,12 @@ public class BlockListener implements Listener { /* HERBALISM */ if (BlockChecks.canBeGreenTerra(block)) { /* Green Terra */ - if (PP.getToolPreparationMode(ToolType.HOE) && permInstance.greenTerra(player)) { + if (profile.getToolPreparationMode(ToolType.HOE) && permInstance.greenTerra(player)) { Skills.abilityCheck(player, SkillType.HERBALISM); } /* Triple drops */ - if (PP.getAbilityMode(AbilityType.GREEN_TERRA)) { + if (profile.getAbilityMode(AbilityType.GREEN_TERRA)) { Herbalism.herbalismProcCheck(block, player, event, plugin); } @@ -210,7 +210,7 @@ public class BlockListener implements Listener { WoodCutting.woodcuttingBlockCheck(player, block); } - if (PP.getAbilityMode(AbilityType.TREE_FELLER) && permInstance.treeFeller(player) && ItemChecks.isAxe(inHand)) { + if (profile.getAbilityMode(AbilityType.TREE_FELLER) && permInstance.treeFeller(player) && ItemChecks.isAxe(inHand)) { WoodCutting.treeFeller(event); } } @@ -268,9 +268,9 @@ public class BlockListener implements Listener { final int LEAF_BLOWER_LEVEL = 100; Player player = event.getPlayer(); - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); - if (PP == null) { + if (profile == null) { return; } @@ -285,35 +285,35 @@ public class BlockListener implements Listener { * ABILITY PREPARATION CHECKS */ if (BlockChecks.abilityBlockCheck(block)) { - if (PP.getToolPreparationMode(ToolType.HOE) && (BlockChecks.canBeGreenTerra(block) || BlockChecks.makeMossy(block))) { + if (profile.getToolPreparationMode(ToolType.HOE) && (BlockChecks.canBeGreenTerra(block) || BlockChecks.makeMossy(block))) { Skills.abilityCheck(player, SkillType.HERBALISM); } - else if (PP.getToolPreparationMode(ToolType.AXE) && BlockChecks.isLog(block) && permInstance.treeFeller(player)) { //TODO: Why are we checking the permissions here? + else if (profile.getToolPreparationMode(ToolType.AXE) && BlockChecks.isLog(block) && permInstance.treeFeller(player)) { //TODO: Why are we checking the permissions here? Skills.abilityCheck(player, SkillType.WOODCUTTING); } - else if (PP.getToolPreparationMode(ToolType.PICKAXE) && BlockChecks.canBeSuperBroken(block)) { + else if (profile.getToolPreparationMode(ToolType.PICKAXE) && BlockChecks.canBeSuperBroken(block)) { Skills.abilityCheck(player, SkillType.MINING); } - else if (PP.getToolPreparationMode(ToolType.SHOVEL) && BlockChecks.canBeGigaDrillBroken(block)) { + else if (profile.getToolPreparationMode(ToolType.SHOVEL) && BlockChecks.canBeGigaDrillBroken(block)) { Skills.abilityCheck(player, SkillType.EXCAVATION); } - else if (PP.getToolPreparationMode(ToolType.FISTS) && (BlockChecks.canBeGigaDrillBroken(block) || material.equals(Material.SNOW))) { + else if (profile.getToolPreparationMode(ToolType.FISTS) && (BlockChecks.canBeGigaDrillBroken(block) || material.equals(Material.SNOW))) { Skills.abilityCheck(player, SkillType.UNARMED); } } /* TREE FELLER SOUNDS */ - if (mcMMO.spoutEnabled && BlockChecks.isLog(block) && PP.getAbilityMode(AbilityType.TREE_FELLER)) { + if (mcMMO.spoutEnabled && BlockChecks.isLog(block) && profile.getAbilityMode(AbilityType.TREE_FELLER)) { SpoutSounds.playSoundForPlayer(SoundEffect.FIZZ, player, block.getLocation()); } /* * ABILITY TRIGGER CHECKS */ - if (PP.getAbilityMode(AbilityType.GREEN_TERRA) && permInstance.greenTerra(player) && BlockChecks.makeMossy(block)) { + if (profile.getAbilityMode(AbilityType.GREEN_TERRA) && permInstance.greenTerra(player) && BlockChecks.makeMossy(block)) { Herbalism.greenTerra(player, block); } - else if (PP.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) { + else if (profile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) { if (configInstance.getExcavationRequiresTool()) { if (ItemChecks.isShovel(inHand)) { event.setInstaBreak(true); @@ -325,7 +325,7 @@ public class BlockListener implements Listener { Excavation.gigaDrillBreaker(player, block); } } - else if (PP.getAbilityMode(AbilityType.BERSERK) && Skills.triggerCheck(player, block, AbilityType.BERSERK)) { + else if (profile.getAbilityMode(AbilityType.BERSERK) && Skills.triggerCheck(player, block, AbilityType.BERSERK)) { if (inHand.getType().equals(Material.AIR)) { FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); plugin.getServer().getPluginManager().callEvent(armswing); @@ -337,7 +337,7 @@ public class BlockListener implements Listener { SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); } } - else if (PP.getAbilityMode(AbilityType.SUPER_BREAKER) && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) { + else if (profile.getAbilityMode(AbilityType.SUPER_BREAKER) && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) { if (configInstance.getMiningRequiresTool()) { if (ItemChecks.isPickaxe(inHand)) { event.setInstaBreak(true); @@ -349,7 +349,7 @@ public class BlockListener implements Listener { Mining.superBreakerBlockCheck(player, block); } } - else if (PP.getSkillLevel(SkillType.WOODCUTTING) >= LEAF_BLOWER_LEVEL && (material.equals(Material.LEAVES) || (configInstance.getBlockModsEnabled() && ModChecks.isCustomLeafBlock(block)))) { + else if (profile.getSkillLevel(SkillType.WOODCUTTING) >= LEAF_BLOWER_LEVEL && (material.equals(Material.LEAVES) || (configInstance.getBlockModsEnabled() && ModChecks.isCustomLeafBlock(block)))) { if (Skills.triggerCheck(player, block, AbilityType.LEAF_BLOWER)) { if (configInstance.getWoodcuttingRequiresTool()) { if (ItemChecks.isAxe(inHand)) { diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index bbca25578..2e3f43000 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -128,9 +128,9 @@ public class EntityListener implements Listener { return; } - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); - if (PP.getGodMode()) { + if (profile.getGodMode()) { event.setCancelled(true); return; } @@ -145,7 +145,7 @@ public class EntityListener implements Listener { } if (event.getDamage() >= 1) { - PP.actualizeRecentlyHurt(); + profile.actualizeRecentlyHurt(); } } } else if (lEntity instanceof Tameable) { @@ -238,7 +238,7 @@ public class EntityListener implements Listener { public void onFoodLevelChange(FoodLevelChangeEvent event) { if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); int currentFoodLevel = player.getFoodLevel(); int newFoodLevel = event.getFoodLevel(); @@ -255,7 +255,7 @@ public class EntityListener implements Listener { if (newFoodLevel > currentFoodLevel) { Material food = player.getItemInHand().getType(); - int herbLevel = PP.getSkillLevel(SkillType.HERBALISM); + int herbLevel = profile.getSkillLevel(SkillType.HERBALISM); int foodChange = newFoodLevel - currentFoodLevel; int rankChange = 0; @@ -312,7 +312,7 @@ public class EntityListener implements Listener { Player player = (Player) event.getOwner(); if (Permissions.getInstance().taming(player) && !event.getEntity().hasMetadata("mcmmoSummoned")) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); EntityType type = event.getEntityType(); int xp = 0; @@ -329,7 +329,7 @@ public class EntityListener implements Listener { break; } - Skills.xpProcessing(player, PP, SkillType.TAMING, xp); + Skills.xpProcessing(player, profile, SkillType.TAMING, xp); } } } diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index a36121c57..91fe1221a 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -57,18 +57,18 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerWorldChangeEvent(PlayerChangedWorldEvent event) { Player player = event.getPlayer(); - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); - if (PP.getGodMode()) { + if (profile.getGodMode()) { if (!Permissions.getInstance().mcgod(player)) { - PP.toggleGodMode(); + profile.toggleGodMode(); player.sendMessage(LocaleLoader.getString("Commands.GodMode.Forbidden")); } } - if (PP.inParty()) { + if (profile.inParty()) { if (!Permissions.getInstance().party(player)) { - PP.removeParty(); + profile.removeParty(); player.sendMessage(LocaleLoader.getString("Party.Forbidden")); } } @@ -312,10 +312,10 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerChat(PlayerChatEvent event) { Player player = event.getPlayer(); - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); - if (PP.getPartyChatMode()) { - Party party = PP.getParty(); + if (profile.getPartyChatMode()) { + Party party = profile.getParty(); if (party == null) { player.sendMessage("You're not in a party, type /p to leave party chat mode."); //TODO: Use mcLocale @@ -341,7 +341,7 @@ public class PlayerListener implements Listener { event.setCancelled(true); } - else if (PP.getAdminChatMode()) { + else if (profile.getAdminChatMode()) { String playerName = player.getName(); McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(playerName, event.getMessage()); plugin.getServer().getPluginManager().callEvent(chatEvent); diff --git a/src/main/java/com/gmail/nossr50/runnables/GainXp.java b/src/main/java/com/gmail/nossr50/runnables/GainXp.java index d97af02f1..b0d46726d 100644 --- a/src/main/java/com/gmail/nossr50/runnables/GainXp.java +++ b/src/main/java/com/gmail/nossr50/runnables/GainXp.java @@ -9,15 +9,15 @@ import com.gmail.nossr50.util.Skills; public class GainXp implements Runnable { private Player player = null; - private PlayerProfile PP = null; + private PlayerProfile profile = null; private double baseXp = 0; private SkillType skillType = null; private LivingEntity target = null; private int baseHealth = 0; - public GainXp(Player player, PlayerProfile PP, SkillType skillType, double baseXp, LivingEntity target) { + public GainXp(Player player, PlayerProfile profile, SkillType skillType, double baseXp, LivingEntity target) { this.player = player; - this.PP = PP; + this.profile = profile; this.skillType = skillType; this.baseXp = baseXp; this.target = target; @@ -39,6 +39,6 @@ public class GainXp implements Runnable { damage += health; } - Skills.xpProcessing(player, PP, skillType, (int) (damage * baseXp)); + Skills.xpProcessing(player, profile, skillType, (int) (damage * baseXp)); } } diff --git a/src/main/java/com/gmail/nossr50/runnables/GreenThumbTimer.java b/src/main/java/com/gmail/nossr50/runnables/GreenThumbTimer.java index f0df6959a..4debdaf5d 100644 --- a/src/main/java/com/gmail/nossr50/runnables/GreenThumbTimer.java +++ b/src/main/java/com/gmail/nossr50/runnables/GreenThumbTimer.java @@ -10,11 +10,11 @@ import com.gmail.nossr50.datatypes.SkillType; public class GreenThumbTimer implements Runnable { private Block block; - private PlayerProfile PP; + private PlayerProfile profile; - public GreenThumbTimer(Block block, PlayerProfile PP) { + public GreenThumbTimer(Block block, PlayerProfile profile) { this.block = block; - this.PP = PP; + this.profile = profile; } @Override @@ -22,14 +22,14 @@ public class GreenThumbTimer implements Runnable { block.setType(Material.CROPS); //This replants the wheat at a certain stage in development based on Herbalism Skill - if (!PP.getAbilityMode(AbilityType.GREEN_TERRA)) { - if (PP.getSkillLevel(SkillType.HERBALISM) >= 600) { + if (!profile.getAbilityMode(AbilityType.GREEN_TERRA)) { + if (profile.getSkillLevel(SkillType.HERBALISM) >= 600) { block.setData(CropState.MEDIUM.getData()); } - else if (PP.getSkillLevel(SkillType.HERBALISM) >= 400) { + else if (profile.getSkillLevel(SkillType.HERBALISM) >= 400) { block.setData(CropState.SMALL.getData()); } - else if (PP.getSkillLevel(SkillType.HERBALISM) >= 200) { + else if (profile.getSkillLevel(SkillType.HERBALISM) >= 200) { block.setData(CropState.VERY_SMALL.getData()); } else { diff --git a/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java b/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java index 8494a623e..a4aa3af67 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java +++ b/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java @@ -22,14 +22,14 @@ public class SkillMonitor implements Runnable { for (Player player : plugin.getServer().getOnlinePlayers()) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); /* * MONITOR SKILLS */ for (SkillType skill : SkillType.values()) { if (skill.getTool() != null && skill.getAbility() != null) { - Skills.monitorSkill(player, PP, curTime, skill); + Skills.monitorSkill(player, profile, curTime, skill); } } @@ -38,7 +38,7 @@ public class SkillMonitor implements Runnable { */ for (AbilityType ability : AbilityType.values()) { if (ability.getCooldown() > 0 ) { - Skills.watchCooldown(player, PP, ability); + Skills.watchCooldown(player, profile, ability); } } } diff --git a/src/main/java/com/gmail/nossr50/skills/combat/Axes.java b/src/main/java/com/gmail/nossr50/skills/combat/Axes.java index d211d6440..522abc4f8 100644 --- a/src/main/java/com/gmail/nossr50/skills/combat/Axes.java +++ b/src/main/java/com/gmail/nossr50/skills/combat/Axes.java @@ -71,8 +71,8 @@ public class Axes { final double PVP_MODIFIER = 1.5; final int PVE_MODIFIER = 2; - PlayerProfile PPa = Users.getProfile(attacker); - int skillLevel = PPa.getSkillLevel(SkillType.AXES); + PlayerProfile attackerProfile = Users.getProfile(attacker); + int skillLevel = attackerProfile.getSkillLevel(SkillType.AXES); int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL); int randomChance = 2000; diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/BlastMining.java b/src/main/java/com/gmail/nossr50/skills/gathering/BlastMining.java index 0f39c5dd9..f0a49c13a 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/BlastMining.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/BlastMining.java @@ -242,9 +242,9 @@ public class BlastMining { * @param plugin mcMMO plugin instance */ public static void detonate(PlayerInteractEvent event, Player player, mcMMO plugin) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); - if (PP.getSkillLevel(SkillType.MINING) < 125) + if (profile.getSkillLevel(SkillType.MINING) < 125) return; Block block = event.getClickedBlock(); @@ -279,8 +279,8 @@ public class BlastMining { AbilityType ability = AbilityType.BLAST_MINING; /* Check Cooldown */ - if (!Skills.cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) { - player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + Skills.calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)"); + if (!Skills.cooldownOver(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) { + player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + Skills.calculateTimeLeft(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)"); return; } @@ -303,7 +303,7 @@ public class BlastMining { /* Disable the original one */ block.setType(Material.AIR); - PP.setSkillDATS(ability, System.currentTimeMillis()); //Save DATS for Blast Mining - PP.setAbilityInformed(ability, false); + profile.setSkillDATS(ability, System.currentTimeMillis()); //Save DATS for Blast Mining + profile.setAbilityInformed(ability, false); } } diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java b/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java index 2d697b454..e4d4f6ab2 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java @@ -40,8 +40,8 @@ public class Excavation { Material type = block.getType(); Location loc = block.getLocation(); - PlayerProfile PP = Users.getProfile(player); - int skillLevel = PP.getSkillLevel(SkillType.EXCAVATION); + PlayerProfile profile = Users.getProfile(player); + int skillLevel = profile.getSkillLevel(SkillType.EXCAVATION); ArrayList is = new ArrayList(); List treasures = new ArrayList(); @@ -112,7 +112,7 @@ public class Excavation { } } - Skills.xpProcessing(player, PP, SkillType.EXCAVATION, xp); + Skills.xpProcessing(player, profile, SkillType.EXCAVATION, xp); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java b/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java index 672d5b530..86ba002fe 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java @@ -37,11 +37,11 @@ public class Fishing { /** * Get the player's current fishing loot tier. * - * @param PP The profile of the player + * @param profile The profile of the player * @return the player's current fishing rank */ - public static int getFishingLootTier(PlayerProfile PP) { - int level = PP.getSkillLevel(SkillType.FISHING); + public static int getFishingLootTier(PlayerProfile profile) { + int level = profile.getSkillLevel(SkillType.FISHING); int fishingTier; if (level >= Config.getInstance().getFishingTierLevelsTier5()) { @@ -70,11 +70,11 @@ public class Fishing { * @param event The event to modify */ private static void getFishingResults(Player player, PlayerFishEvent event) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); List rewards = new ArrayList(); Item theCatch = (Item) event.getCaught(); - switch (getFishingLootTier(PP)) { + switch (getFishingLootTier(profile)) { case 1: rewards = TreasuresConfig.getInstance().fishingRewardsTier1; break; @@ -123,7 +123,7 @@ public class Fishing { theCatch.getItemStack().setDurability((short) (random.nextInt(maxDurability))); //Change durability to random value } - Skills.xpProcessing(player, PP, SkillType.FISHING, Config.getInstance().getFishingBaseXP()); + Skills.xpProcessing(player, profile, SkillType.FISHING, Config.getInstance().getFishingBaseXP()); } /** @@ -133,7 +133,7 @@ public class Fishing { */ public static void processResults(PlayerFishEvent event) { Player player = event.getPlayer(); - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); getFishingResults(player, event); Item theCatch = (Item) event.getCaught(); @@ -164,7 +164,7 @@ public class Fishing { } /* Actual chance to have an enchantment is related to your fishing skill */ - if (random.nextInt(15) < Fishing.getFishingLootTier(PP)) { + if (random.nextInt(15) < Fishing.getFishingLootTier(profile)) { enchanted = true; int randomEnchantLevel = random.nextInt(newEnchant.getMaxLevel()) + 1; diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java index 9e5b12ce3..fa87624b8 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java @@ -75,10 +75,10 @@ public class Herbalism { * @param plugin mcMMO plugin instance */ public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) { - final PlayerProfile PP = Users.getProfile(player); + final PlayerProfile profile = Users.getProfile(player); final int MAX_BONUS_LEVEL = 1000; - int herbLevel = PP.getSkillLevel(SkillType.HERBALISM); + int herbLevel = profile.getSkillLevel(SkillType.HERBALISM); int id = block.getTypeId(); Material type = block.getType(); @@ -307,7 +307,7 @@ public class Herbalism { } } - Skills.xpProcessing(player, PP, SkillType.HERBALISM, xp); + Skills.xpProcessing(player, profile, SkillType.HERBALISM, xp); } /** @@ -321,8 +321,8 @@ public class Herbalism { private static void greenThumbWheat(Block block, Player player, BlockBreakEvent event, mcMMO plugin) { final int MAX_BONUS_LEVEL = 1500; - PlayerProfile PP = Users.getProfile(player); - int herbLevel = PP.getSkillLevel(SkillType.HERBALISM); + PlayerProfile profile = Users.getProfile(player); + int herbLevel = profile.getSkillLevel(SkillType.HERBALISM); PlayerInventory inventory = player.getInventory(); boolean hasSeeds = inventory.contains(Material.SEEDS); Location loc = block.getLocation(); @@ -333,13 +333,13 @@ public class Herbalism { randomChance = (int) (randomChance * 0.75); } - if (hasSeeds && PP.getAbilityMode(AbilityType.GREEN_TERRA) || hasSeeds && (herbLevel > MAX_BONUS_LEVEL || random.nextInt(randomChance) <= herbLevel)) { + if (hasSeeds && profile.getAbilityMode(AbilityType.GREEN_TERRA) || hasSeeds && (herbLevel > MAX_BONUS_LEVEL || random.nextInt(randomChance) <= herbLevel)) { event.setCancelled(true); Misc.dropItem(loc, new ItemStack(Material.WHEAT)); Misc.randomDropItems(loc, new ItemStack(Material.SEEDS), 50, 3); - plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new GreenThumbTimer(block, PP), 1); + plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new GreenThumbTimer(block, profile), 1); inventory.removeItem(new ItemStack(Material.SEEDS)); player.updateInventory(); // Needed until replacement available @@ -356,8 +356,8 @@ public class Herbalism { public static void greenThumbBlocks(ItemStack is, Player player, Block block) { final int MAX_BONUS_LEVEL = 1500; - PlayerProfile PP = Users.getProfile(player); - int skillLevel = PP.getSkillLevel(SkillType.HERBALISM); + PlayerProfile profile = Users.getProfile(player); + int skillLevel = profile.getSkillLevel(SkillType.HERBALISM); int seeds = is.getAmount(); player.setItemInHand(new ItemStack(Material.SEEDS, seeds - 1)); diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java b/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java index 95e23289b..4bb90bd95 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java @@ -222,7 +222,7 @@ public class Mining { * @param block The block to award XP for */ public static void miningXP(Player player, Block block) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); Material type = block.getType(); int xp = 0; @@ -287,7 +287,7 @@ public class Mining { break; } - Skills.xpProcessing(player, PP, SkillType.MINING, xp); + Skills.xpProcessing(player, profile, SkillType.MINING, xp); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java b/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java index 9ef42bbd4..8f6e74884 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java @@ -41,12 +41,12 @@ public class WoodCutting { public static void treeFeller(BlockBreakEvent event) { Player player = event.getPlayer(); Block firstBlock = event.getBlock(); - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); ArrayList toBeFelled = new ArrayList(); /* NOTE: Tree Feller will cut upwards like how you actually fell trees */ processTreeFelling(firstBlock, toBeFelled); - removeBlocks(toBeFelled, player, PP); + removeBlocks(toBeFelled, player, profile); } /** @@ -54,9 +54,9 @@ public class WoodCutting { * * @param toBeFelled List of Blocks to be removed from the tree * @param player The player using the ability - * @param PP The PlayerProfile of the player + * @param profile The PlayerProfile of the player */ - private static void removeBlocks(ArrayList toBeFelled, Player player, PlayerProfile PP) { + private static void removeBlocks(ArrayList toBeFelled, Player player, PlayerProfile profile) { if (toBeFelled.size() >= Config.getInstance().getTreeFellerThreshold()) { player.sendMessage(LocaleLoader.getString("Woodcutting.Skills.TreeFellerThreshold")); return; @@ -213,7 +213,7 @@ public class WoodCutting { } if (Permissions.getInstance().woodcutting(player)) { - Skills.xpProcessing(player, PP, SkillType.WOODCUTTING, xp); + Skills.xpProcessing(player, profile, SkillType.WOODCUTTING, xp); } } @@ -375,7 +375,7 @@ public class WoodCutting { * @param block The block being broken */ public static void woodcuttingBlockCheck(Player player, Block block) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); int xp = 0; TreeSpecies species = TreeSpecies.getByData(block.getData()); @@ -410,7 +410,7 @@ public class WoodCutting { } WoodCutting.woodCuttingProcCheck(player, block); - Skills.xpProcessing(player, PP, SkillType.WOODCUTTING, xp); + Skills.xpProcessing(player, profile, SkillType.WOODCUTTING, xp); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java index 2c4d9922a..862842524 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java @@ -31,18 +31,18 @@ public class Repair { * Handle the XP gain for repair events. * * @param player Player repairing the item - * @param PP PlayerProfile of the repairing player + * @param profile PlayerProfile of the repairing player * @param is Item being repaired * @param durabilityBefore Durability of the item before repair * @param modify Amount to modify the durability by * @param boost True if the modifier is a boost, false if the modifier is a reduction */ - protected static void xpHandler(Player player, PlayerProfile PP, short durabilityBefore, short durabilityAfter, double modify) { + protected static void xpHandler(Player player, PlayerProfile profile, short durabilityBefore, short durabilityAfter, double modify) { short dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (dif * modify); - Skills.xpProcessing(player, PP, SkillType.REPAIR, dif * 10); + Skills.xpProcessing(player, profile, SkillType.REPAIR, dif * 10); //CLANG CLANG if (mcMMO.spoutEnabled) { @@ -53,11 +53,11 @@ public class Repair { /** * Get current Arcane Forging rank. * - * @param skillLevel The skill level of the player whose rank is being checked + * @param profile The PlayerProfile of the player to get the rank for * @return The player's current Arcane Forging rank */ - public static int getArcaneForgingRank(PlayerProfile PP) { - int skillLevel = PP.getSkillLevel(SkillType.REPAIR); + public static int getArcaneForgingRank(PlayerProfile profile) { + int skillLevel = profile.getSkillLevel(SkillType.REPAIR); if (skillLevel >= configInstance.getArcaneForgingRankLevels4()) { return 4; @@ -250,9 +250,9 @@ public class Repair { * @param anvilID The item ID of the anvil block */ public static void placedAnvilCheck(Player player, int anvilID) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); - if (!PP.getPlacedAnvil()) { + if (!profile.getPlacedAnvil()) { if (mcMMO.spoutEnabled) { SpoutPlayer sPlayer = SpoutManager.getPlayer(player); @@ -264,7 +264,7 @@ public class Repair { player.sendMessage(LocaleLoader.getString("Repair.Listener.Anvil")); } - PP.togglePlacedAnvil(); + profile.togglePlacedAnvil(); } } } diff --git a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java index ce1f3cc87..b27241764 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java @@ -60,10 +60,10 @@ public class SimpleRepairManager implements RepairManager { @Override public void handleRepair(Player player, ItemStack item) { // Load some variables for use - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); short startDurability = item.getDurability(); PlayerInventory inventory = player.getInventory(); - int skillLevel = PP.getSkillLevel(SkillType.REPAIR); + int skillLevel = profile.getSkillLevel(SkillType.REPAIR); Repairable repairable = repairables.get(item.getTypeId()); // Permissions checks on material and item types @@ -147,7 +147,7 @@ public class SimpleRepairManager implements RepairManager { removeOneFrom(inventory, repairItemLocation); // Give out XP like candy - Repair.xpHandler(player, PP, startDurability, newDurability, repairable.getXpMultiplier()); + Repair.xpHandler(player, profile, startDurability, newDurability, repairable.getXpMultiplier()); // Repair the item! item.setDurability(newDurability); diff --git a/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java b/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java index f0a55cf6e..f3e3cf6f4 100644 --- a/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java +++ b/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java @@ -202,8 +202,8 @@ public class SpoutStuff { * @param sPlayer The player that leveled up */ public static void levelUpNotification(SkillType skillType, SpoutPlayer sPlayer) { - PlayerProfile PP = Users.getProfile(sPlayer); - int notificationTier = getNotificationTier(PP.getSkillLevel(skillType)); + PlayerProfile profile = Users.getProfile(sPlayer); + int notificationTier = getNotificationTier(profile.getSkillLevel(skillType)); Material mat = null; switch (skillType) { @@ -519,7 +519,7 @@ public class SpoutStuff { } //TODO: Use Locale - sPlayer.sendNotification(ChatColor.GREEN + "Level Up!", ChatColor.YELLOW + Misc.getCapitalized(skillType.toString()) + ChatColor.DARK_AQUA + " (" + ChatColor.GREEN + PP.getSkillLevel(skillType) + ChatColor.DARK_AQUA + ")", mat); + sPlayer.sendNotification(ChatColor.GREEN + "Level Up!", ChatColor.YELLOW + Misc.getCapitalized(skillType.toString()) + ChatColor.DARK_AQUA + " (" + ChatColor.GREEN + profile.getSkillLevel(skillType) + ChatColor.DARK_AQUA + ")", mat); SpoutSounds.playLevelUpNoise(sPlayer, plugin); } diff --git a/src/main/java/com/gmail/nossr50/util/Combat.java b/src/main/java/com/gmail/nossr50/util/Combat.java index d6752cb65..24df2fba2 100644 --- a/src/main/java/com/gmail/nossr50/util/Combat.java +++ b/src/main/java/com/gmail/nossr50/util/Combat.java @@ -61,7 +61,7 @@ public class Combat { case PLAYER: Player attacker = (Player) event.getDamager(); ItemStack itemInHand = attacker.getItemInHand(); - PlayerProfile PPa = Users.getProfile(attacker); + PlayerProfile attackerProfile = Users.getProfile(attacker); if (ItemChecks.isSword(itemInHand)) { if (targetIsPlayer || targetIsTamedPet) { @@ -79,11 +79,11 @@ public class Combat { swordsManager.bleedCheck(target); - if (PPa.getAbilityMode(AbilityType.SERRATED_STRIKES)) { + if (attackerProfile.getAbilityMode(AbilityType.SERRATED_STRIKES)) { swordsManager.serratedStrikes(target, event.getDamage()); } - startGainXp(attacker, PPa, target, SkillType.SWORDS); + startGainXp(attacker, attackerProfile, target, SkillType.SWORDS); } else if (ItemChecks.isAxe(itemInHand) && permInstance.axes(attacker)) { if (targetIsPlayer || targetIsTamedPet) { @@ -109,11 +109,11 @@ public class Combat { Axes.impact(attacker, target, event); } - if (PPa.getAbilityMode(AbilityType.SKULL_SPLIITER) && permInstance.skullSplitter(attacker)) { + if (attackerProfile.getAbilityMode(AbilityType.SKULL_SPLIITER) && permInstance.skullSplitter(attacker)) { applyAbilityAoE(attacker, target, event.getDamage() / 2, SkillType.AXES); } - startGainXp(attacker, PPa, target, SkillType.AXES); + startGainXp(attacker, attackerProfile, target, SkillType.AXES); } else if (itemInHand.getType() == Material.AIR && permInstance.unarmed(attacker)) { if (targetIsPlayer || targetIsTamedPet) { @@ -131,7 +131,7 @@ public class Combat { unarmedManager.bonusDamage(event); - if (PPa.getAbilityMode(AbilityType.BERSERK) && permInstance.berserk(attacker)) { + if (attackerProfile.getAbilityMode(AbilityType.BERSERK) && permInstance.berserk(attacker)) { event.setDamage((int) (event.getDamage() * 1.5)); } @@ -139,7 +139,7 @@ public class Combat { unarmedManager.disarmCheck((Player) target); } - startGainXp(attacker, PPa, target, SkillType.UNARMED); + startGainXp(attacker, attackerProfile, target, SkillType.UNARMED); } else if (itemInHand.getType() == Material.BONE && target instanceof Tameable) { TamingManager tamingManager = new TamingManager(attacker); @@ -257,8 +257,8 @@ public class Combat { } if (target != shooter) { - PlayerProfile PP = Users.getProfile(shooter); - startGainXp(shooter, PP, target, SkillType.ARCHERY); + PlayerProfile profile = Users.getProfile(shooter); + startGainXp(shooter, profile, target, SkillType.ARCHERY); } } @@ -380,11 +380,11 @@ public class Combat { * Start the task that gives combat XP. * * @param attacker The attacking player - * @param PP The player's PlayerProfile + * @param profile The player's PlayerProfile * @param target The defending entity * @param skillType The skill being used */ - public static void startGainXp(Player attacker, PlayerProfile PP, LivingEntity target, SkillType skillType) { + public static void startGainXp(Player attacker, PlayerProfile profile, LivingEntity target, SkillType skillType) { double baseXP = 0; if (target instanceof Player) { @@ -474,7 +474,7 @@ public class Combat { } if (baseXP != 0) { - mcMMO.p.getServer().getScheduler().scheduleSyncDelayedTask(mcMMO.p, new GainXp(attacker, PP, skillType, baseXP, target), 0); + mcMMO.p.getServer().getScheduler().scheduleSyncDelayedTask(mcMMO.p, new GainXp(attacker, profile, skillType, baseXP, target), 0); } } diff --git a/src/main/java/com/gmail/nossr50/util/Item.java b/src/main/java/com/gmail/nossr50/util/Item.java index 99cbfd701..1eb4aa9b9 100644 --- a/src/main/java/com/gmail/nossr50/util/Item.java +++ b/src/main/java/com/gmail/nossr50/util/Item.java @@ -26,13 +26,13 @@ public class Item { } private static void chimaeraWing(Player player) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); ItemStack inHand = player.getItemInHand(); Block block = player.getLocation().getBlock(); int amount = inHand.getAmount(); if (Permissions.getInstance().chimaeraWing(player) && inHand.getTypeId() == Config.getInstance().getChimaeraItemId()) { - if (Skills.cooldownOver(PP.getRecentlyHurt(), 60, player) && amount >= Config.getInstance().getChimaeraCost()) { + if (Skills.cooldownOver(profile.getRecentlyHurt(), 60, player) && amount >= Config.getInstance().getChimaeraCost()) { player.setItemInHand(new ItemStack(Config.getInstance().getChimaeraItemId(), amount - Config.getInstance().getChimaeraCost())); for (int y = 1; block.getY() + y < player.getWorld().getMaxHeight(); y++) { @@ -52,8 +52,8 @@ public class Item { player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Pass")); } - else if (!Skills.cooldownOver(PP.getRecentlyHurt(), 60, player) && amount >= Config.getInstance().getChimaeraCost()) { - player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", new Object[] {Skills.calculateTimeLeft(PP.getRecentlyHurt(), 60)})); + else if (!Skills.cooldownOver(profile.getRecentlyHurt(), 60, player) && amount >= Config.getInstance().getChimaeraCost()) { + player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", new Object[] {Skills.calculateTimeLeft(profile.getRecentlyHurt(), 60)})); } else if (amount <= Config.getInstance().getChimaeraCost()) { player.sendMessage(LocaleLoader.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + Misc.prettyItemString(Config.getInstance().getChimaeraItemId())); diff --git a/src/main/java/com/gmail/nossr50/util/Skills.java b/src/main/java/com/gmail/nossr50/util/Skills.java index 8c25f707d..5ef16db46 100644 --- a/src/main/java/com/gmail/nossr50/util/Skills.java +++ b/src/main/java/com/gmail/nossr50/util/Skills.java @@ -75,12 +75,12 @@ public class Skills { * Sends a message to the player when the cooldown expires. * * @param player The player to send a message to - * @param PP The profile of the player + * @param profile The profile of the player * @param ability The ability to watch cooldowns for */ - public static void watchCooldown(Player player, PlayerProfile PP, AbilityType ability) { - if (!PP.getAbilityInformed(ability) && cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) { - PP.setAbilityInformed(ability, true); + public static void watchCooldown(Player player, PlayerProfile profile, AbilityType ability) { + if (!profile.getAbilityInformed(ability) && cooldownOver(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) { + profile.setAbilityInformed(ability, true); player.sendMessage(ability.getAbilityRefresh()); } } @@ -96,7 +96,7 @@ public class Skills { return; } - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); AbilityType ability = skill.getAbility(); ToolType tool = skill.getTool(); ItemStack inHand = player.getItemInHand(); @@ -106,12 +106,12 @@ public class Skills { } /* Check if any abilities are active */ - if (!PP.getAbilityUse()) { + if (!profile.getAbilityUse()) { return; } for (AbilityType x : AbilityType.values()) { - if (PP.getAbilityMode(x)) { + if (profile.getAbilityMode(x)) { return; } } @@ -119,10 +119,10 @@ public class Skills { /* Woodcutting & Axes need to be treated differently. * Basically the tool always needs to ready and we check to see if the cooldown is over when the user takes action */ - if (ability.getPermissions(player) && tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) { + if (ability.getPermissions(player) && tool.inHand(inHand) && !profile.getToolPreparationMode(tool)) { if (skill != SkillType.WOODCUTTING && skill != SkillType.AXES) { - if (!PP.getAbilityMode(ability) && !cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) { - player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)"); + if (!profile.getAbilityMode(ability) && !cooldownOver(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) { + player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)"); return; } } @@ -131,8 +131,8 @@ public class Skills { player.sendMessage(tool.getRaiseTool()); } - PP.setToolPreparationATS(tool, System.currentTimeMillis()); - PP.setToolPreparationMode(tool, true); + profile.setToolPreparationATS(tool, System.currentTimeMillis()); + profile.setToolPreparationMode(tool, true); } } @@ -140,18 +140,18 @@ public class Skills { * Monitors various things relating to skill abilities. * * @param player The player using the skill - * @param PP The profile of the player + * @param profile The profile of the player * @param curTime The current system time * @param skill The skill being monitored */ - public static void monitorSkill(Player player, PlayerProfile PP, long curTime, SkillType skill) { + public static void monitorSkill(Player player, PlayerProfile profile, long curTime, SkillType skill) { final int FOUR_SECONDS = 4000; ToolType tool = skill.getTool(); AbilityType ability = skill.getAbility(); - if (PP.getToolPreparationMode(tool) && curTime - (PP.getToolPreparationATS(tool) * TIME_CONVERSION_FACTOR) >= FOUR_SECONDS) { - PP.setToolPreparationMode(tool, false); + if (profile.getToolPreparationMode(tool) && curTime - (profile.getToolPreparationATS(tool) * TIME_CONVERSION_FACTOR) >= FOUR_SECONDS) { + profile.setToolPreparationMode(tool, false); if (Config.getInstance().getAbilityMessagesEnabled()) { player.sendMessage(tool.getLowerTool()); @@ -159,9 +159,9 @@ public class Skills { } if (ability.getPermissions(player)) { - if (PP.getAbilityMode(ability) && (PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR) <= curTime) { - PP.setAbilityMode(ability, false); - PP.setAbilityInformed(ability, false); + if (profile.getAbilityMode(ability) && (profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR) <= curTime) { + profile.setAbilityMode(ability, false); + profile.setAbilityInformed(ability, false); player.sendMessage(ability.getAbilityOff()); for (Player nearbyPlayer : player.getWorld().getPlayers()) { @@ -180,14 +180,14 @@ public class Skills { * @param player The player whose skill to update */ public static void processLeaderboardUpdate(SkillType skillType, Player player) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); PlayerStat ps = new PlayerStat(); if (skillType != SkillType.ALL) { - ps.statVal = PP.getSkillLevel(skillType); + ps.statVal = profile.getSkillLevel(skillType); } else { - ps.statVal = PP.getPowerLevel(); + ps.statVal = profile.getPowerLevel(); } ps.name = player.getName(); @@ -389,14 +389,14 @@ public class Skills { * @param type The skill the ability is based on */ public static void abilityCheck(Player player, SkillType type) { - PlayerProfile PP = Users.getProfile(player); + PlayerProfile profile = Users.getProfile(player); ToolType tool = type.getTool(); - if (!PP.getToolPreparationMode(tool)) { + if (!profile.getToolPreparationMode(tool)) { return; } - PP.setToolPreparationMode(tool, false); + profile.setToolPreparationMode(tool, false); AbilityType ability = type.getAbility(); @@ -404,13 +404,13 @@ public class Skills { * We show them the too tired message when they take action. */ if (type == SkillType.WOODCUTTING || type == SkillType.AXES) { - if (!PP.getAbilityMode(ability) && !cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) { - player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)"); + if (!profile.getAbilityMode(ability) && !cooldownOver(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) { + player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)"); return; } } - int ticks = 2 + (PP.getSkillLevel(type) / 50); + int ticks = 2 + (profile.getSkillLevel(type) / 50); if (player.hasPermission("mcmmo.perks.activationtime.twelveseconds")) { ticks = ticks + 12; @@ -428,7 +428,7 @@ public class Skills { ticks = maxTicks; } - if (!PP.getAbilityMode(ability) && cooldownOver(PP.getSkillDATS(ability), ability.getCooldown(), player)) { + if (!profile.getAbilityMode(ability) && cooldownOver(profile.getSkillDATS(ability), ability.getCooldown(), player)) { player.sendMessage(ability.getAbilityOn()); for (Player y : player.getWorld().getPlayers()) { @@ -437,8 +437,8 @@ public class Skills { } } - PP.setSkillDATS(ability, System.currentTimeMillis() + (ticks * TIME_CONVERSION_FACTOR)); - PP.setAbilityMode(ability, true); + profile.setSkillDATS(ability, System.currentTimeMillis() + (ticks * TIME_CONVERSION_FACTOR)); + profile.setAbilityMode(ability, true); } }