diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index 9f4f7cff..1a0630c7 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -39,6 +39,7 @@ import org.bukkit.entity.Player; import org.bukkit.entity.Tameable; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.FireworkMeta; +import org.jetbrains.annotations.Nullable; import com.gamingmesh.jobs.api.JobsJoinEvent; import com.gamingmesh.jobs.api.JobsLeaveEvent; @@ -64,6 +65,7 @@ import com.gamingmesh.jobs.stuff.Util; import net.Zrips.CMILib.ActionBar.CMIActionBar; import net.Zrips.CMILib.Items.CMIItemStack; +import net.Zrips.CMILib.Logs.CMIDebug; import net.Zrips.CMILib.Messages.CMIMessages; import net.Zrips.CMILib.NBT.CMINBT; import net.Zrips.CMILib.Version.Version; @@ -188,24 +190,10 @@ public class PlayerManager { * @return {@link PlayerInfo} */ public PlayerInfo getPlayerInfo(String name) { - if (Version.isCurrentEqualOrLower(Version.v1_11_R1) || !Version.isPaper()) { - JobsPlayer jPlayer = playersNameCache.get(name.toLowerCase()); - if (jPlayer == null) - return null; - return playerUUIDMap.get(jPlayer.getUniqueId()); - } - JobsPlayer jPlayer = playersNameCache.get(name.toLowerCase()); - - if (jPlayer != null) { - return playerUUIDMap.get(jPlayer.getUniqueId()); - } - - UUID playerUUID = Bukkit.getPlayerUniqueId(name); - if (playerUUID == null) + if (jPlayer == null) return null; - - return playerUUIDMap.get(playerUUID); + return playerUUIDMap.get(jPlayer.getUniqueId()); } /** @@ -388,27 +376,7 @@ public class PlayerManager { * @return {@link JobsPlayer} the player job info of the player */ public JobsPlayer getJobsPlayer(String playerName) { - if (Version.isCurrentEqualOrLower(Version.v1_11_R1) || !Version.isPaper()) { - return playersNameCache.get(playerName.toLowerCase()); - } - - JobsPlayer jPlayer = playersNameCache.get(playerName.toLowerCase()); - - if (jPlayer != null) { - return jPlayer; - } - - UUID playerUUID = Bukkit.getPlayerUniqueId(playerName); - - if (playerUUID == null) - return null; - jPlayer = playersUUID.get(playerUUID); - - if (jPlayer != null) { - playersNameCache.put(playerName.toLowerCase(), jPlayer); - } - - return jPlayer != null ? jPlayer : playersUUIDCache.get(playerUUID); + return playersNameCache.get(playerName.toLowerCase()); } /**