Because PP is an awful variable name.

This commit is contained in:
GJ 2012-07-03 10:04:04 -04:00
parent 96e70aa4d2
commit caf9c07ba3
29 changed files with 214 additions and 214 deletions

View File

@ -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) }));
}
}
}

View File

@ -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;
}

View File

@ -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 <player>"; //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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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"));

View File

@ -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 <message>"; //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 {

View File

@ -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 <party-name> <message>"; //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 {

View File

@ -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()) {

View File

@ -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)) {

View File

@ -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);
}
}
}

View File

@ -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);

View File

@ -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));
}
}

View File

@ -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 {

View File

@ -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);
}
}
}

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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<ItemStack> is = new ArrayList<ItemStack>();
List<ExcavationTreasure> treasures = new ArrayList<ExcavationTreasure>();
@ -112,7 +112,7 @@ public class Excavation {
}
}
Skills.xpProcessing(player, PP, SkillType.EXCAVATION, xp);
Skills.xpProcessing(player, profile, SkillType.EXCAVATION, xp);
}
/**

View File

@ -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<FishingTreasure> rewards = new ArrayList<FishingTreasure>();
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;

View File

@ -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));

View File

@ -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);
}
/**

View File

@ -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<Block> toBeFelled = new ArrayList<Block>();
/* 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<Block> toBeFelled, Player player, PlayerProfile PP) {
private static void removeBlocks(ArrayList<Block> 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);
}
/**

View File

@ -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();
}
}
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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()));

View File

@ -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);
}
}