From 1dbe56b026c47bdce3ca296c88f3be7eb53cc341 Mon Sep 17 00:00:00 2001 From: bm01 Date: Sun, 3 Feb 2013 13:40:56 +0100 Subject: [PATCH] Replaced deprecated calls to Users.getProfile() in our listeners --- .../com/gmail/nossr50/listeners/BlockListener.java | 2 +- .../gmail/nossr50/listeners/PlayerListener.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index efc5a2551..6aa13611a 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -263,7 +263,7 @@ public class BlockListener implements Listener { return; } - PlayerProfile profile = Users.getProfile(player); + PlayerProfile profile = Users.getPlayer(player).getProfile(); Block block = event.getBlock(); /* diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 6d61e3b92..83e757052 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -22,6 +22,7 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.chat.ChatManager; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; @@ -62,7 +63,7 @@ public class PlayerListener implements Listener { return; } - PlayerProfile profile = Users.getProfile(player); + PlayerProfile profile = Users.getPlayer(player).getProfile(); if (profile.getGodMode() && !Permissions.mcgod(player)) { profile.toggleGodMode(); @@ -88,11 +89,12 @@ public class PlayerListener implements Listener { return; } - int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.FISHING); + McMMOPlayer mcMMOPlayer = Users.getPlayer(player); + int skillLevel = mcMMOPlayer.getProfile().getSkillLevel(SkillType.FISHING); switch (event.getState()) { case CAUGHT_FISH: - Fishing.beginFishing(Users.getPlayer(player), skillLevel, event); + Fishing.beginFishing(mcMMOPlayer, skillLevel, event); break; case CAUGHT_ENTITY: @@ -176,9 +178,7 @@ public class PlayerListener implements Listener { return; } - PlayerProfile profile = Users.getProfile(player); - - profile.actualizeRespawnATS(); + Users.getPlayer(player).getProfile().actualizeRespawnATS(); } /** @@ -334,7 +334,7 @@ public class PlayerListener implements Listener { return; } - PlayerProfile profile = Users.getProfile(player); + PlayerProfile profile = Users.getPlayer(player).getProfile(); if (profile.getPartyChatMode()) { Party party = profile.getParty();