mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-02 04:25:26 +02:00
Use OnlineMMOPlayer over McMMOPlayer
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.api;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
|
||||
@@ -39,7 +39,7 @@ public final class AbilityAPI {
|
||||
}
|
||||
|
||||
public static boolean isAnyAbilityEnabled(Player player) {
|
||||
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
|
||||
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
|
||||
|
||||
for (SuperAbilityType ability : SuperAbilityType.values()) {
|
||||
if (mmoPlayer.getSuperAbilityManager().getAbilityMode(ability)) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.api;
|
||||
|
||||
import com.gmail.nossr50.datatypes.chat.ChatChannel;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -16,11 +16,11 @@ public final class ChatAPI {
|
||||
*
|
||||
* @param player target player
|
||||
* @return true if the player is targeting the party chat channel
|
||||
* @deprecated Use {@link #isUsingPartyChat(McMMOPlayer)} instead
|
||||
* @deprecated Use {@link #isUsingPartyChat(OnlineMMOPlayer)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isUsingPartyChat(@NotNull Player player) {
|
||||
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
|
||||
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
|
||||
|
||||
if(mmoPlayer != null)
|
||||
return mmoPlayer.getChatChannel() == ChatChannel.PARTY;
|
||||
@@ -29,12 +29,12 @@ public final class ChatAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a {@link McMMOPlayer} is in the Party chat channel
|
||||
* Check if a {@link OnlineMMOPlayer} is in the Party chat channel
|
||||
*
|
||||
* @param mmoPlayer target player
|
||||
* @return true if the player is targeting the party chat channel
|
||||
*/
|
||||
public static boolean isUsingPartyChat(@NotNull McMMOPlayer mmoPlayer) {
|
||||
public static boolean isUsingPartyChat(@NotNull OnlineMMOPlayer mmoPlayer) {
|
||||
return mmoPlayer.getChatChannel() == ChatChannel.PARTY;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class ChatAPI {
|
||||
*
|
||||
* @param playerName The name of the player to check
|
||||
* @return true if the player is using party chat, false otherwise
|
||||
* @deprecated use {@link #isUsingPartyChat(McMMOPlayer)} instead for performance reasons
|
||||
* @deprecated use {@link #isUsingPartyChat(OnlineMMOPlayer)} instead for performance reasons
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isUsingPartyChat(String playerName) {
|
||||
@@ -59,11 +59,11 @@ public final class ChatAPI {
|
||||
*
|
||||
* @param player target player
|
||||
* @return true if the player is targeting the admin chat channel
|
||||
* @deprecated Use {@link #isUsingAdminChat(McMMOPlayer)} instead
|
||||
* @deprecated Use {@link #isUsingAdminChat(OnlineMMOPlayer)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isUsingAdminChat(@NotNull Player player) {
|
||||
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
|
||||
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
|
||||
|
||||
if(mmoPlayer != null)
|
||||
return mmoPlayer.getChatChannel() == ChatChannel.ADMIN;
|
||||
@@ -72,12 +72,12 @@ public final class ChatAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a {@link McMMOPlayer} is in the Admin chat channel
|
||||
* Check if a {@link OnlineMMOPlayer} is in the Admin chat channel
|
||||
*
|
||||
* @param mmoPlayer target player
|
||||
* @return true if the player is targeting the admin chat channel
|
||||
*/
|
||||
public static boolean isUsingAdminChat(@NotNull McMMOPlayer mmoPlayer) {
|
||||
public static boolean isUsingAdminChat(@NotNull OnlineMMOPlayer mmoPlayer) {
|
||||
return mmoPlayer.getChatChannel() == ChatChannel.ADMIN;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public final class ChatAPI {
|
||||
*
|
||||
* @param playerName The name of the player to check
|
||||
* @return true if the player is using admin chat, false otherwise
|
||||
* @deprecated use {@link #isUsingAdminChat(McMMOPlayer)} instead for performance reasons
|
||||
* @deprecated use {@link #isUsingAdminChat(OnlineMMOPlayer)} instead for performance reasons
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isUsingAdminChat(String playerName) {
|
||||
@@ -98,11 +98,11 @@ public final class ChatAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the party chat channel of a {@link McMMOPlayer}
|
||||
* Toggle the party chat channel of a {@link OnlineMMOPlayer}
|
||||
*
|
||||
* @param mmoPlayer The player to toggle party chat on.
|
||||
*/
|
||||
public static void togglePartyChat(@NotNull McMMOPlayer mmoPlayer) {
|
||||
public static void togglePartyChat(@NotNull OnlineMMOPlayer mmoPlayer) {
|
||||
mcMMO.p.getChatManager().setOrToggleChatChannel(mmoPlayer, ChatChannel.PARTY);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public final class ChatAPI {
|
||||
* Toggle the party chat mode of a player.
|
||||
*
|
||||
* @param player The player to toggle party chat on.
|
||||
* @deprecated use {@link #togglePartyChat(McMMOPlayer)}
|
||||
* @deprecated use {@link #togglePartyChat(OnlineMMOPlayer)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static void togglePartyChat(Player player) throws NullPointerException {
|
||||
@@ -121,7 +121,7 @@ public final class ChatAPI {
|
||||
* Toggle the party chat mode of a player.
|
||||
*
|
||||
* @param playerName The name of the player to toggle party chat on.
|
||||
* @deprecated Use {@link #togglePartyChat(McMMOPlayer)} instead
|
||||
* @deprecated Use {@link #togglePartyChat(OnlineMMOPlayer)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static void togglePartyChat(String playerName) throws NullPointerException {
|
||||
@@ -129,11 +129,11 @@ public final class ChatAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the admin chat channel of a {@link McMMOPlayer}
|
||||
* Toggle the admin chat channel of a {@link OnlineMMOPlayer}
|
||||
*
|
||||
* @param mmoPlayer The player to toggle admin chat on.
|
||||
*/
|
||||
public static void toggleAdminChat(@NotNull McMMOPlayer mmoPlayer) {
|
||||
public static void toggleAdminChat(@NotNull OnlineMMOPlayer mmoPlayer) {
|
||||
mcMMO.p.getChatManager().setOrToggleChatChannel(mmoPlayer, ChatChannel.ADMIN);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public final class ChatAPI {
|
||||
* Toggle the admin chat mode of a player.
|
||||
*
|
||||
* @param player The player to toggle admin chat on.
|
||||
* @deprecated Use {@link #toggleAdminChat(McMMOPlayer)} instead
|
||||
* @deprecated Use {@link #toggleAdminChat(OnlineMMOPlayer)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static void toggleAdminChat(Player player) throws NullPointerException {
|
||||
@@ -152,7 +152,7 @@ public final class ChatAPI {
|
||||
* Toggle the admin chat mode of a player.
|
||||
*
|
||||
* @param playerName The name of the player to toggle party chat on.
|
||||
* @deprecated Use {@link #toggleAdminChat(McMMOPlayer)} instead
|
||||
* @deprecated Use {@link #toggleAdminChat(OnlineMMOPlayer)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static void toggleAdminChat(String playerName) throws NullPointerException {
|
||||
|
@@ -6,7 +6,7 @@ import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.experience.FormulaType;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainSource;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
@@ -47,7 +47,7 @@ public final class ExperienceAPI {
|
||||
* @deprecated Draft API
|
||||
*/
|
||||
@Deprecated
|
||||
public static void addCombatXP(McMMOPlayer mmoPlayer, LivingEntity target, PrimarySkillType primarySkillType, double multiplier) {
|
||||
public static void addCombatXP(OnlineMMOPlayer mmoPlayer, LivingEntity target, PrimarySkillType primarySkillType, double multiplier) {
|
||||
CombatUtils.processCombatXP(mmoPlayer, target, primarySkillType, multiplier);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public final class ExperienceAPI {
|
||||
* @deprecated Draft API
|
||||
*/
|
||||
@Deprecated
|
||||
public static void addCombatXP(McMMOPlayer mmoPlayer, LivingEntity target, PrimarySkillType primarySkillType) {
|
||||
public static void addCombatXP(OnlineMMOPlayer mmoPlayer, LivingEntity target, PrimarySkillType primarySkillType) {
|
||||
CombatUtils.processCombatXP(mmoPlayer, target, primarySkillType);
|
||||
}
|
||||
|
||||
@@ -1064,7 +1064,7 @@ public final class ExperienceAPI {
|
||||
* @param blockStates the blocks to reward XP for
|
||||
* @param mmoPlayer the target player
|
||||
*/
|
||||
public static void addXpFromBlocks(ArrayList<BlockState> blockStates, McMMOPlayer mmoPlayer)
|
||||
public static void addXpFromBlocks(ArrayList<BlockState> blockStates, OnlineMMOPlayer mmoPlayer)
|
||||
{
|
||||
for(BlockState bs : blockStates)
|
||||
{
|
||||
@@ -1084,7 +1084,7 @@ public final class ExperienceAPI {
|
||||
* @param mmoPlayer the target player
|
||||
* @param skillType target primary skill
|
||||
*/
|
||||
public static void addXpFromBlocksBySkill(ArrayList<BlockState> blockStates, McMMOPlayer mmoPlayer, PrimarySkillType skillType)
|
||||
public static void addXpFromBlocksBySkill(ArrayList<BlockState> blockStates, OnlineMMOPlayer mmoPlayer, PrimarySkillType skillType)
|
||||
{
|
||||
for(BlockState bs : blockStates)
|
||||
{
|
||||
@@ -1100,7 +1100,7 @@ public final class ExperienceAPI {
|
||||
* @param blockState The target blockstate
|
||||
* @param mmoPlayer The target player
|
||||
*/
|
||||
public static void addXpFromBlock(BlockState blockState, McMMOPlayer mmoPlayer)
|
||||
public static void addXpFromBlock(BlockState blockState, OnlineMMOPlayer mmoPlayer)
|
||||
{
|
||||
for(PrimarySkillType skillType : PrimarySkillType.values())
|
||||
{
|
||||
@@ -1117,7 +1117,7 @@ public final class ExperienceAPI {
|
||||
* @param mmoPlayer The target player
|
||||
* @param skillType target primary skill
|
||||
*/
|
||||
public static void addXpFromBlockBySkill(BlockState blockState, McMMOPlayer mmoPlayer, PrimarySkillType skillType)
|
||||
public static void addXpFromBlockBySkill(BlockState blockState, OnlineMMOPlayer mmoPlayer, PrimarySkillType skillType)
|
||||
{
|
||||
if(ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0)
|
||||
{
|
||||
@@ -1208,11 +1208,11 @@ public final class ExperienceAPI {
|
||||
/**
|
||||
* @deprecated Use UserManager::getPlayer(Player player) instead
|
||||
* @param player target player
|
||||
* @return McMMOPlayer for that player if the profile is loaded, otherwise null
|
||||
* @return OnlineMMOPlayer for that player if the profile is loaded, otherwise null
|
||||
* @throws McMMOPlayerNotFoundException
|
||||
*/
|
||||
@Deprecated
|
||||
private static McMMOPlayer getPlayer(Player player) throws McMMOPlayerNotFoundException {
|
||||
private static OnlineMMOPlayer getPlayer(Player player) throws McMMOPlayerNotFoundException {
|
||||
if (!mcMMO.getUserManager().hasPlayerDataKey(player)) {
|
||||
throw new McMMOPlayerNotFoundException(player);
|
||||
}
|
||||
|
Reference in New Issue
Block a user