Use OnlineMMOPlayer over McMMOPlayer

This commit is contained in:
nossr50
2020-12-22 13:43:12 -08:00
parent 573d9d014e
commit b7f713a50f
119 changed files with 460 additions and 460 deletions

View File

@@ -2,7 +2,7 @@ package com.gmail.nossr50.util;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.items.ChimaeraWingWarmup;
@@ -25,7 +25,7 @@ import java.util.ArrayList;
import java.util.List;
public final class ChimaeraWing {
private static McMMOPlayer mmoPlayer;
private static OnlineMMOPlayer mmoPlayer;
private static Location location;
private ChimaeraWing() {}

View File

@@ -4,7 +4,7 @@ import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.party.Party;
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.datatypes.skills.SubSkillType;
@@ -92,9 +92,9 @@ public final class EventUtils {
* This little method is just to make the code more readable
*
* @param entity target entity
* @return the associated McMMOPlayer for this entity
* @return the associated OnlineMMOPlayer for this entity
*/
public static McMMOPlayer getMcMMOPlayer(@NotNull Entity entity)
public static OnlineMMOPlayer getMcMMOPlayer(@NotNull Entity entity)
{
return mcMMO.getUserManager().queryPlayer((Player)entity);
}
@@ -144,7 +144,7 @@ public final class EventUtils {
return true;
}
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
if(mmoPlayer == null)
{
@@ -273,7 +273,7 @@ public final class EventUtils {
}
public static void handlePartyTeleportEvent(Player teleportingPlayer, Player targetPlayer) {
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(teleportingPlayer);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(teleportingPlayer);
if(mmoPlayer == null)
return;
@@ -386,7 +386,7 @@ public final class EventUtils {
HashMap<String, Integer> levelChangedVictim = eventVictim.getLevelChanged();
HashMap<String, Float> experienceChangedVictim = eventVictim.getExperienceChanged();
McMMOPlayer killerPlayer = mcMMO.getUserManager().queryPlayer(killer);
OnlineMMOPlayer killerPlayer = mcMMO.getUserManager().queryPlayer(killer);
//Not loaded
if(killerPlayer == null)

View File

@@ -3,7 +3,7 @@ package com.gmail.nossr50.util;
import com.gmail.nossr50.commands.skills.AprilCommand;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
@@ -368,7 +368,7 @@ public final class HolidayManager {
if(!Config.getInstance().isAprilFoolsAllowed())
return;
final McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
final OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
if (mmoPlayer == null) return;
int levelTotal = Misc.getRandom().nextInt(1 + mmoPlayer.getSkillLevel(PrimarySkillType.MINING)) + 1;

View File

@@ -1,7 +1,7 @@
package com.gmail.nossr50.util;
import com.gmail.nossr50.api.ItemSpawnReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
@@ -307,7 +307,7 @@ public final class Misc {
* @param mmoPlayer target player
* @return true if the player is the party leader
*/
public static boolean isPartyLeader(@NotNull McMMOPlayer mmoPlayer) {
public static boolean isPartyLeader(@NotNull OnlineMMOPlayer mmoPlayer) {
return mmoPlayer.getParty().getLeader().getUniqueId().equals(mmoPlayer.getPlayer().getUniqueId());
}

View File

@@ -1,7 +1,7 @@
package com.gmail.nossr50.util.commands;
import com.gmail.nossr50.config.Config;
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.locale.LocaleLoader;
@@ -77,7 +77,7 @@ public final class CommandUtils {
*
* @return true if the player is online and a valid mmoPlayer object was found
*/
public static boolean checkPlayerExistence(CommandSender sender, String playerName, McMMOPlayer mmoPlayer) {
public static boolean checkPlayerExistence(CommandSender sender, String playerName, OnlineMMOPlayer mmoPlayer) {
if (mmoPlayer != null) {
if (CommandUtils.hidden(sender, mmoPlayer.getPlayer(), false)) {
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));

View File

@@ -2,7 +2,7 @@ package com.gmail.nossr50.util.experience;
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.skills.PrimarySkillType;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
@@ -16,11 +16,11 @@ public class ExperienceUtils {
* @param primarySkillType Skill being used
* @param xp Experience amount to add
*/
public static void applyXpGain(@NotNull McMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, float xp, @NotNull XPGainReason xpGainReason, @NotNull XPGainSource xpGainSource) {
public static void applyXpGain(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, float xp, @NotNull XPGainReason xpGainReason, @NotNull XPGainSource xpGainSource) {
mmoPlayer.getExperienceManager().applyXpGain(primarySkillType, xp, xpGainReason, xpGainSource);
}
public static void processPostXpEvent(@NotNull McMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, @NotNull Plugin plugin, @NotNull XPGainSource xpGainSource) {
public static void processPostXpEvent(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, @NotNull Plugin plugin, @NotNull XPGainSource xpGainSource) {
mmoPlayer.getExperienceManager().processPostXpEvent(primarySkillType, plugin, xpGainSource);
}
@@ -29,7 +29,7 @@ public class ExperienceUtils {
*
* @param primarySkillType The skill to check
*/
public static void updateLevelStats(@NotNull McMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, @NotNull XPGainReason xpGainReason, @NotNull XPGainSource xpGainSource) {
public static void updateLevelStats(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, @NotNull XPGainReason xpGainReason, @NotNull XPGainSource xpGainSource) {
mmoPlayer.getExperienceManager().updateLevelStats(primarySkillType, xpGainReason, xpGainSource);
}
}

View File

@@ -1,7 +1,7 @@
package com.gmail.nossr50.util.experience;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.CoreSkillConstants;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
@@ -21,7 +21,7 @@ import java.util.Map;
* Each ExperienceBarManager only manages a single player
*/
public class MMOExperienceBarManager {
private final McMMOPlayer mmoPlayer;
private final OnlineMMOPlayer mmoPlayer;
int delaySeconds = 3;
@@ -31,7 +31,7 @@ public class MMOExperienceBarManager {
private @NotNull final HashMap<SkillIdentity, ExperienceBarHideTask> experienceBarHideTaskHashMap;
public MMOExperienceBarManager(@NotNull McMMOPlayer mmoPlayer, @NotNull Map<SkillIdentity, SkillBossBarState> barStateMapRef)
public MMOExperienceBarManager(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull Map<SkillIdentity, SkillBossBarState> barStateMapRef)
{
this.mmoPlayer = mmoPlayer;
this.barStateMapRef = barStateMapRef;

View File

@@ -2,7 +2,7 @@ package com.gmail.nossr50.util.input;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@@ -26,10 +26,10 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
public class AbilityActivationProcessor {
private final McMMOPlayer mmoPlayer;
private final OnlineMMOPlayer mmoPlayer;
private final Player player;
public AbilityActivationProcessor(McMMOPlayer mmoPlayer) {
public AbilityActivationProcessor(OnlineMMOPlayer mmoPlayer) {
this.mmoPlayer = mmoPlayer;
this.player = mmoPlayer.getPlayer();
}

View File

@@ -3,7 +3,7 @@ package com.gmail.nossr50.util.input;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.player.PersistentPlayerData;
import com.gmail.nossr50.datatypes.skills.AbilityToolType;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
@@ -28,7 +28,7 @@ import java.util.Map;
public class SuperAbilityManager {
private final McMMOPlayer mmoPlayer;
private final OnlineMMOPlayer mmoPlayer;
private final Player player;
private final Map<SuperAbilityType, Boolean> superAbilityState = new HashMap<>();
@@ -39,7 +39,7 @@ public class SuperAbilityManager {
private final Map<AbilityToolType, Boolean> toolMode = new HashMap<>();
private final PersistentPlayerData persistentPlayerData;
public SuperAbilityManager(@NotNull McMMOPlayer mmoPlayer, @NotNull PersistentPlayerData persistentPlayerData) {
public SuperAbilityManager(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull PersistentPlayerData persistentPlayerData) {
this.mmoPlayer = mmoPlayer;
this.persistentPlayerData = persistentPlayerData;
this.player = mmoPlayer.getPlayer();

View File

@@ -4,7 +4,7 @@ import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.notifications.SensitiveCommandType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.events.skills.McMMOPlayerNotificationEvent;
@@ -37,7 +37,7 @@ public class NotificationManager {
*/
public static void sendPlayerInformation(@NotNull Player player, @NotNull NotificationType notificationType, @NotNull String key)
{
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
if(mmoPlayer == null || !mmoPlayer.hasSkillChatNotifications())
return;
@@ -53,7 +53,7 @@ public class NotificationManager {
public static boolean doesPlayerUseNotifications(@NotNull Player player)
{
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
if(mmoPlayer == null)
return false;
@@ -78,7 +78,7 @@ public class NotificationManager {
public static void sendPlayerInformationChatOnly(@NotNull Player player, @NotNull String key, String... values)
{
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
if(mmoPlayer == null || !mmoPlayer.hasSkillChatNotifications())
return;
@@ -89,7 +89,7 @@ public class NotificationManager {
public static void sendPlayerInformationChatOnlyPrefixed(@NotNull Player player, @NotNull String key, String... values)
{
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
if(mmoPlayer == null || !mmoPlayer.hasSkillChatNotifications())
return;
@@ -149,7 +149,7 @@ public class NotificationManager {
* @param skillName skill that leveled up
* @param newLevel new level of that skill
*/
public static void sendPlayerLevelUpNotification(McMMOPlayer mmoPlayer, PrimarySkillType skillName, int levelsGained, int newLevel)
public static void sendPlayerLevelUpNotification(OnlineMMOPlayer mmoPlayer, PrimarySkillType skillName, int levelsGained, int newLevel)
{
if(!mmoPlayer.hasSkillChatNotifications())
return;
@@ -170,7 +170,7 @@ public class NotificationManager {
}
}
public static void sendPlayerUnlockNotification(@NotNull McMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
public static void sendPlayerUnlockNotification(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
{
if(!mmoPlayer.hasSkillChatNotifications())
return;

View File

@@ -1,6 +1,6 @@
package com.gmail.nossr50.util.player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import org.jetbrains.annotations.NotNull;
@@ -18,7 +18,7 @@ public class PlayerLevelUtils {
* @param primarySkillType target skill
* @return if the player would qualify for the XP boost if its enabled
*/
public static boolean qualifiesForEarlyGameBoost(@NotNull McMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType) {
public static boolean qualifiesForEarlyGameBoost(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType) {
return mmoPlayer.getSkillLevel(primarySkillType) < mcMMO.getPlayerLevelUtils().getEarlyGameCutoff(primarySkillType);
}
}

View File

@@ -2,7 +2,7 @@ package com.gmail.nossr50.util.player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.MMODataSnapshot;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.player.PersistentPlayerData;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.mcMMO;
@@ -26,7 +26,7 @@ import java.util.UUID;
//TODO: Add per world handling
public final class UserManager {
private final @NotNull HashSet<McMMOPlayer> playerDataSet; //Used to track players for sync saves on shutdown
private final @NotNull HashSet<OnlineMMOPlayer> playerDataSet; //Used to track players for sync saves on shutdown
public UserManager() {
this.playerDataSet = new HashSet<>();
@@ -37,7 +37,7 @@ public final class UserManager {
*
* @param mmoPlayer the player profile to start tracking
*/
public void track(@NotNull McMMOPlayer mmoPlayer) {
public void track(@NotNull OnlineMMOPlayer mmoPlayer) {
mmoPlayer.getPlayer().setMetadata(mcMMO.playerDataKey, new FixedMetadataValue(mcMMO.p, mmoPlayer));
playerDataSet.add(mmoPlayer); //for sync saves on shutdown
@@ -48,21 +48,21 @@ public final class UserManager {
*
* @param mmoPlayer target player
*/
public void cleanupPlayer(@NotNull McMMOPlayer mmoPlayer) {
public void cleanupPlayer(@NotNull OnlineMMOPlayer mmoPlayer) {
playerDataSet.remove(mmoPlayer);
}
/**
* Gets the McMMOPlayer object for a player, this can be null if the player has not yet been loaded.
* Gets the OnlineMMOPlayer object for a player, this can be null if the player has not yet been loaded.
* @param player target player
* @return McMMOPlayer object for this player, null if Player has not been loaded
* @return OnlineMMOPlayer object for this player, null if Player has not been loaded
*/
public @Nullable McMMOPlayer queryPlayer(@Nullable Player player) {
public @Nullable OnlineMMOPlayer queryPlayer(@Nullable Player player) {
if(player == null)
return null;
if(player.hasMetadata(mcMMO.playerDataKey))
return (McMMOPlayer) player.getMetadata(mcMMO.playerDataKey).get(0).value();
return (OnlineMMOPlayer) player.getMetadata(mcMMO.playerDataKey).get(0).value();
else
return null;
}
@@ -77,7 +77,7 @@ public final class UserManager {
* @param player The Player object
*/
public void remove(@NotNull Player player) {
McMMOPlayer mmoPlayer = queryPlayer(player);
OnlineMMOPlayer mmoPlayer = queryPlayer(player);
if(mmoPlayer != null) {
mmoPlayer.cleanup();
@@ -98,8 +98,8 @@ public final class UserManager {
playerDataSet.clear(); //Clear sync save tracking
}
public @NotNull Collection<McMMOPlayer> getPlayers() {
Collection<McMMOPlayer> playerCollection = new ArrayList<>();
public @NotNull Collection<OnlineMMOPlayer> getPlayers() {
Collection<OnlineMMOPlayer> playerCollection = new ArrayList<>();
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
if (hasPlayerDataKey(player)) {
@@ -136,11 +136,11 @@ public final class UserManager {
* Save all users ON THIS THREAD.
*/
public void saveAllSync() {
ImmutableList<McMMOPlayer> trackedSyncData = ImmutableList.copyOf(playerDataSet);
ImmutableList<OnlineMMOPlayer> trackedSyncData = ImmutableList.copyOf(playerDataSet);
mcMMO.p.getLogger().info("Saving player data... (" + trackedSyncData.size() + ")");
for (McMMOPlayer onlinePlayer : trackedSyncData) {
for (OnlineMMOPlayer onlinePlayer : trackedSyncData) {
try
{
mcMMO.p.getLogger().info("Saving data for player: "+onlinePlayer.getPlayerName());
@@ -161,7 +161,7 @@ public final class UserManager {
*
* @param syncSave if true, data is saved synchronously
*/
public void logout(@NotNull McMMOPlayer mmoPlayer, boolean syncSave) {
public void logout(@NotNull OnlineMMOPlayer mmoPlayer, boolean syncSave) {
BleedTimerTask.bleedOut(mmoPlayer.getPlayer());
//TODO: There is a possibility that async saves don't execute in time if the server is told to shutdown

View File

@@ -1,7 +1,7 @@
package com.gmail.nossr50.util.random;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.util.Permissions;
@@ -22,7 +22,7 @@ public class RandomChanceSkill implements RandomChanceExecution {
this.subSkillType = subSkillType;
this.probabilityCap = RandomChanceUtil.LINEAR_CURVE_VAR;
final McMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
final OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
if (player != null && mmoPlayer != null) {
this.skillLevel = mmoPlayer.getSkillLevel(primarySkillType);
} else {
@@ -43,7 +43,7 @@ public class RandomChanceSkill implements RandomChanceExecution {
this.subSkillType = subSkillType;
this.probabilityCap = RandomChanceUtil.LINEAR_CURVE_VAR;
final McMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
final OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
if (player != null && mmoPlayer != null) {
this.skillLevel = mmoPlayer.getSkillLevel(primarySkillType);
} else {
@@ -68,7 +68,7 @@ public class RandomChanceSkill implements RandomChanceExecution {
this.primarySkillType = subSkillType.getParentSkill();
this.subSkillType = subSkillType;
final McMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
final OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
if (player != null && mmoPlayer != null) {
this.skillLevel = mmoPlayer.getSkillLevel(primarySkillType);
} else {
@@ -93,7 +93,7 @@ public class RandomChanceSkill implements RandomChanceExecution {
this.primarySkillType = subSkillType.getParentSkill();
this.subSkillType = subSkillType;
final McMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
final OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
if (player != null && mmoPlayer != null) {
this.skillLevel = mmoPlayer.getSkillLevel(primarySkillType);
} else {

View File

@@ -1,7 +1,7 @@
package com.gmail.nossr50.util.random;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
@@ -328,7 +328,7 @@ public class RandomChanceUtil
return displayValues;
}
public static String[] calculateAbilityDisplayValuesStatic(@NotNull McMMOPlayer mmoPlayer, PrimarySkillType primarySkillType, double chance) {
public static String[] calculateAbilityDisplayValuesStatic(@NotNull OnlineMMOPlayer mmoPlayer, PrimarySkillType primarySkillType, double chance) {
RandomChanceStatic rcs = new RandomChanceStatic(chance, false);
double successChance = getRandomChanceExecutionChance(rcs);

View File

@@ -2,7 +2,7 @@ package com.gmail.nossr50.util.scoreboards;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.database.PlayerStat;
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.datatypes.skills.SuperAbilityType;

View File

@@ -2,7 +2,7 @@ package com.gmail.nossr50.util.scoreboards;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.database.PlayerStat;
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.datatypes.skills.SuperAbilityType;
@@ -62,7 +62,7 @@ public class ScoreboardWrapper {
powerObjective.setDisplayName(ScoreboardManager.TAG_POWER_LEVEL);
powerObjective.setDisplaySlot(DisplaySlot.BELOW_NAME);
for (McMMOPlayer mmoPlayer : mcMMO.getUserManager().getPlayers()) {
for (OnlineMMOPlayer mmoPlayer : mcMMO.getUserManager().getPlayers()) {
powerObjective.getScore(mmoPlayer.getPlayerName()).setScore(mmoPlayer.getExperienceManager().getPowerLevel());
}
}
@@ -433,7 +433,7 @@ public class ScoreboardWrapper {
return;
}
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
if(mmoPlayer == null)
return;

View File

@@ -5,7 +5,7 @@ import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.meta.OldName;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
@@ -75,7 +75,7 @@ public final class CombatUtils {
return;
}
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
//Make sure the profiles been loaded
if(mmoPlayer == null) {
@@ -125,7 +125,7 @@ public final class CombatUtils {
return;
}
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
//Make sure the profiles been loaded
if(mmoPlayer == null) {
@@ -140,7 +140,7 @@ public final class CombatUtils {
}
private static void printFinalDamageDebug(@NotNull Player player, @NotNull EntityDamageByEntityEvent event, @NotNull McMMOPlayer mcMMOPlayer, @Nullable String @Nullable ... extraInfoLines) {
private static void printFinalDamageDebug(@NotNull Player player, @NotNull EntityDamageByEntityEvent event, @NotNull OnlineMMOPlayer mcMMOPlayer, @Nullable String @Nullable ... extraInfoLines) {
if(mcMMOPlayer.isDebugMode()) {
player.sendMessage("Final Damage value after mcMMO modifiers: "+ event.getFinalDamage());
if(extraInfoLines != null) {
@@ -161,7 +161,7 @@ public final class CombatUtils {
double finalDamage = initialDamage;
Map<DamageModifier, Double> modifiers = getModifiers(event);
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
//Make sure the profiles been loaded
if(mmoPlayer == null) {
@@ -212,7 +212,7 @@ public final class CombatUtils {
double initialDamage = event.getDamage();
double finalDamage = initialDamage;
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
//Make sure the profiles been loaded
if(mmoPlayer == null) {
@@ -253,7 +253,7 @@ public final class CombatUtils {
double finalDamage = initialDamage;
if(master != null && master.isOnline() && master.isValid()) {
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(master);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(master);
//Make sure the profiles been loaded
if(mmoPlayer == null) {
@@ -285,7 +285,7 @@ public final class CombatUtils {
private static void processArcheryCombat(@NotNull LivingEntity target, @NotNull Player player, @NotNull EntityDamageByEntityEvent event, @NotNull Projectile arrow) {
double initialDamage = event.getDamage();
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
//Make sure the profiles been loaded
if(mmoPlayer == null) {
@@ -334,7 +334,7 @@ public final class CombatUtils {
private static void processCrossbowCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event, Projectile arrow) {
double initialDamage = event.getDamage();
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
//Make sure the profiles been loaded
if(mmoPlayer == null) {
@@ -393,7 +393,7 @@ public final class CombatUtils {
return;
}
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
AcrobaticsManager acrobaticsManager = mmoPlayer.getAcrobaticsManager();
if (acrobaticsManager.canDodge(target)) {
@@ -514,7 +514,7 @@ public final class CombatUtils {
}
if (target.getType() != EntityType.CREEPER && !Misc.isNPCEntityExcludingVillagers(player) && PrimarySkillType.TAMING.getPermissions(player)) {
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
if(mmoPlayer == null) {
return;
@@ -558,7 +558,7 @@ public final class CombatUtils {
* @param subSkillType the specific limit break skill for calculations
* @return the RAW damage bonus from Limit Break which is applied before reductions
*/
public static int getLimitBreakDamage(@NotNull McMMOPlayer attacker, @NotNull LivingEntity defender, @NotNull SubSkillType subSkillType) {
public static int getLimitBreakDamage(@NotNull OnlineMMOPlayer attacker, @NotNull LivingEntity defender, @NotNull SubSkillType subSkillType) {
if(defender instanceof Player) {
Player playerDefender = (Player) defender;
return getLimitBreakDamageAgainstQuality(attacker, subSkillType, getArmorQualityLevel(playerDefender));
@@ -575,7 +575,7 @@ public final class CombatUtils {
* @param armorQualityLevel Armor quality level
* @return the RAW damage boost after its been mutated by armor quality
*/
public static int getLimitBreakDamageAgainstQuality(@NotNull McMMOPlayer attacker, @NotNull SubSkillType subSkillType, int armorQualityLevel) {
public static int getLimitBreakDamageAgainstQuality(@NotNull OnlineMMOPlayer attacker, @NotNull SubSkillType subSkillType, int armorQualityLevel) {
int rawDamageBoost = RankUtils.getRank(attacker, subSkillType);
if(armorQualityLevel <= 4) {
@@ -620,7 +620,7 @@ public final class CombatUtils {
* @param mmoPlayer target entity
* @return true if the mmoPlayer has access to the limit break
*/
public static boolean canUseLimitBreak(@NotNull McMMOPlayer mmoPlayer, LivingEntity target, @NotNull SubSkillType subSkillType) {
public static boolean canUseLimitBreak(@NotNull OnlineMMOPlayer mmoPlayer, LivingEntity target, @NotNull SubSkillType subSkillType) {
if(target instanceof Player || AdvancedConfig.getInstance().canApplyLimitBreakPVE()) {
return RankUtils.hasUnlockedSubskill(mmoPlayer, subSkillType)
&& Permissions.isSubSkillEnabled(mmoPlayer.getPlayer(), subSkillType);
@@ -795,7 +795,7 @@ public final class CombatUtils {
* @param target The defending entity
* @param primarySkillType The skill being used
*/
public static void processCombatXP(@NotNull McMMOPlayer mmoPlayer, LivingEntity target, PrimarySkillType primarySkillType) {
public static void processCombatXP(@NotNull OnlineMMOPlayer mmoPlayer, LivingEntity target, PrimarySkillType primarySkillType) {
processCombatXP(mmoPlayer, target, primarySkillType, 1.0);
}
@@ -807,7 +807,7 @@ public final class CombatUtils {
* @param primarySkillType The skill being used
* @param multiplier final XP result will be multiplied by this
*/
public static void processCombatXP(@NotNull McMMOPlayer mmoPlayer, LivingEntity target, PrimarySkillType primarySkillType, double multiplier) {
public static void processCombatXP(@NotNull OnlineMMOPlayer mmoPlayer, LivingEntity target, PrimarySkillType primarySkillType, double multiplier) {
double baseXP = 0;
XPGainReason xpGainReason;

View File

@@ -1,7 +1,7 @@
package com.gmail.nossr50.util.skills;
import com.gmail.nossr50.config.RankConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@@ -25,7 +25,7 @@ public class RankUtils {
* @param primarySkillType target skill
* @param newLevel the new level of this skill
*/
public static void executeSkillUnlockNotifications(@NotNull Plugin plugin, @NotNull McMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, int newLevel)
public static void executeSkillUnlockNotifications(@NotNull Plugin plugin, @NotNull OnlineMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, int newLevel)
{
for(SubSkillType subSkillType : primarySkillType.getSkillAbilities())
{
@@ -105,7 +105,7 @@ public class RankUtils {
* @param subSkillType the target subskill
* @return true if the player has at least one rank in the skill
*/
public static boolean hasUnlockedSubskill(@NotNull McMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
public static boolean hasUnlockedSubskill(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
{
int curRank = getRank(mmoPlayer, subSkillType);
@@ -119,7 +119,7 @@ public class RankUtils {
* @param abstractSubSkill the target subskill
* @return true if the player has at least one rank in the skill
*/
public static boolean hasUnlockedSubskill(@NotNull McMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
public static boolean hasUnlockedSubskill(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
{
int curRank = getRank(mmoPlayer, abstractSubSkill);
@@ -134,7 +134,7 @@ public class RankUtils {
* @param subSkillType the target subskill
* @return true if the player is at least that rank in this subskill
*/
public static boolean hasReachedRank(int rank, @NotNull McMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
public static boolean hasReachedRank(int rank, @NotNull OnlineMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
{
return getRank(mmoPlayer, subSkillType) >= rank;
}
@@ -146,7 +146,7 @@ public class RankUtils {
* @param abstractSubSkill the target subskill
* @return true if the player is at least that rank in this subskill
*/
public static boolean hasReachedRank(int rank, @NotNull McMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
public static boolean hasReachedRank(int rank, @NotNull OnlineMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
{
return getRank(mmoPlayer, abstractSubSkill) >= rank;
}
@@ -168,7 +168,7 @@ public class RankUtils {
* @param subSkillType Target subskill
* @return The rank the player currently has achieved in this skill. -1 for skills without ranks.
*/
public static int getRank(@NotNull McMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
public static int getRank(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
{
String skillName = subSkillType.toString();
int numRanks = subSkillType.getNumRanks();
@@ -212,7 +212,7 @@ public class RankUtils {
* @param abstractSubSkill Target subskill
* @return The rank the player currently has achieved in this skill. -1 for skills without ranks.
*/
public static int getRank(@NotNull McMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
public static int getRank(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
{
String skillName = abstractSubSkill.getConfigKeyName();
int numRanks = abstractSubSkill.getNumRanks();
@@ -365,7 +365,7 @@ public class RankUtils {
return getRankUnlockLevel(superAbilityType.getSubSkillTypeDefinition(), 1);
}
public static boolean isPlayerMaxRankInSubSkill(@NotNull McMMOPlayer mmoPlayer, SubSkillType subSkillType) {
public static boolean isPlayerMaxRankInSubSkill(@NotNull OnlineMMOPlayer mmoPlayer, SubSkillType subSkillType) {
int playerRank = getRank(mmoPlayer, subSkillType);
int highestRank = getHighestRank(subSkillType);

View File

@@ -6,7 +6,7 @@ import com.gmail.nossr50.config.HiddenConfig;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@@ -44,11 +44,11 @@ public final class SkillUtils {
*/
private SkillUtils() {}
public static void applyXpGain(@NotNull McMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, float xp, @NotNull XPGainReason xpGainReason) {
public static void applyXpGain(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, float xp, @NotNull XPGainReason xpGainReason) {
mmoPlayer.getExperienceManager().beginXpGain(mmoPlayer.getPlayer(), primarySkillType, xp, xpGainReason, XPGainSource.SELF);
}
public static void applyXpGain(@NotNull McMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, float xp, @NotNull XPGainReason xpGainReason, @NotNull XPGainSource xpGainSource) {
public static void applyXpGain(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull PrimarySkillType primarySkillType, float xp, @NotNull XPGainReason xpGainReason, @NotNull XPGainSource xpGainSource) {
mmoPlayer.getExperienceManager().beginXpGain(mmoPlayer.getPlayer(), primarySkillType, xp, xpGainReason, xpGainSource);
}
@@ -67,7 +67,7 @@ public final class SkillUtils {
* Skill Stat Calculations
*/
public static @NotNull String[] calculateLengthDisplayValues(@NotNull McMMOPlayer mmoPlayer, float skillValue, @NotNull PrimarySkillType skill) {
public static @NotNull String[] calculateLengthDisplayValues(@NotNull OnlineMMOPlayer mmoPlayer, float skillValue, @NotNull PrimarySkillType skill) {
int maxLength = skill.getSuperAbilityType().getMaxLength();
int abilityLengthVar = AdvancedConfig.getInstance().getAbilityLength();
int abilityLengthCap = AdvancedConfig.getInstance().getAbilityLengthCap();
@@ -94,7 +94,7 @@ public final class SkillUtils {
* Others
*/
public static int handleFoodSkills(@NotNull McMMOPlayer mmoPlayer, int eventFoodLevel, @NotNull SubSkillType subSkillType) {
public static int handleFoodSkills(@NotNull OnlineMMOPlayer mmoPlayer, int eventFoodLevel, @NotNull SubSkillType subSkillType) {
int curRank = RankUtils.getRank(mmoPlayer, subSkillType);
int currentFoodLevel = mmoPlayer.getPlayer().getFoodLevel();
@@ -114,7 +114,7 @@ public final class SkillUtils {
*
* @return the number of seconds remaining before the cooldown expires
*/
public static int calculateTimeLeft(long deactivatedTimeStamp, int cooldown, @NotNull McMMOPlayer mmoPlayer) {
public static int calculateTimeLeft(long deactivatedTimeStamp, int cooldown, @NotNull OnlineMMOPlayer mmoPlayer) {
return (int) (((deactivatedTimeStamp + (PerksUtils.handleCooldownPerks(mmoPlayer.getPlayer(), cooldown) * Misc.TIME_CONVERSION_FACTOR)) - System.currentTimeMillis()) / Misc.TIME_CONVERSION_FACTOR);
}
@@ -188,7 +188,7 @@ public final class SkillUtils {
}
}
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
//Not Loaded
if(mmoPlayer == null)

View File

@@ -1,6 +1,6 @@
package com.gmail.nossr50.util.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
@@ -21,7 +21,7 @@ public class SmeltingTracker {
private void changeFurnaceOwnership(Furnace furnace, Player player) {
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
/*
Debug output
@@ -37,7 +37,7 @@ public class SmeltingTracker {
mcMMO.getCompatibilityManager().getPersistentDataLayer().setFurnaceOwner(furnace, player.getUniqueId());
}
private void printOwnershipGainDebug(Furnace furnace, McMMOPlayer mmoPlayer) {
private void printOwnershipGainDebug(Furnace furnace, OnlineMMOPlayer mmoPlayer) {
if(mmoPlayer != null) {
if(mmoPlayer.isDebugMode()) {
mmoPlayer.getPlayer().sendMessage("Furnace ownership " +
@@ -52,7 +52,7 @@ public class SmeltingTracker {
OfflinePlayer furnaceOwner = getFurnaceOwner(furnace);
if(furnaceOwner != null && furnaceOwner.isOnline()) {
McMMOPlayer furnaceOwnerProfile = mcMMO.getUserManager().queryPlayer(furnaceOwner.getPlayer());
OnlineMMOPlayer furnaceOwnerProfile = mcMMO.getUserManager().queryPlayer(furnaceOwner.getPlayer());
if(furnaceOwnerProfile != null) {
if(furnaceOwnerProfile.isDebugMode()) {

View File

@@ -4,7 +4,7 @@ import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.RankConfig;
import com.gmail.nossr50.datatypes.json.McMMOUrl;
import com.gmail.nossr50.datatypes.json.McMMOWebLinks;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
@@ -63,7 +63,7 @@ public class TextComponentFactory {
return Component.text(text);
}
public static void sendPlayerSubSkillWikiLink(McMMOPlayer mmoPlayer, String subskillformatted)
public static void sendPlayerSubSkillWikiLink(OnlineMMOPlayer mmoPlayer, String subskillformatted)
{
if(!Config.getInstance().getUrlLinksEnabled())
return;
@@ -82,7 +82,7 @@ public class TextComponentFactory {
mcMMO.getAudiences().player(mmoPlayer.getPlayer()).sendMessage(Identity.nil(), wikiLinkComponent, MessageType.SYSTEM);
}
public static void sendPlayerUrlHeader(@NotNull McMMOPlayer mmoPlayer) {
public static void sendPlayerUrlHeader(@NotNull OnlineMMOPlayer mmoPlayer) {
TextComponent prefix = Component.text(LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Prefix") + " ");
/*prefix.setColor(ChatColor.DARK_AQUA);*/
TextComponent suffix = Component.text(" "+LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Suffix"));
@@ -241,7 +241,7 @@ public class TextComponentFactory {
return ClickEvent.openUrl(url);
}
private static Component getSubSkillTextComponent(@NotNull McMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
private static Component getSubSkillTextComponent(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
{
//Get skill name
String skillName = subSkillType.getLocaleName();
@@ -259,7 +259,7 @@ public class TextComponentFactory {
return textComponent.build();
}
private static TextComponent getSubSkillTextComponent(@NotNull McMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
private static TextComponent getSubSkillTextComponent(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
{
//String key = abstractSubSkill.getConfigKeyName();
String skillName = abstractSubSkill.getNiceName();
@@ -280,7 +280,7 @@ public class TextComponentFactory {
return textComponent.build();
}
private static TextComponent.Builder initNewSkillTextComponent(@NotNull McMMOPlayer mmoPlayer, @NotNull String skillName, @NotNull SubSkillType subSkillType, boolean skillUnlocked) {
private static TextComponent.Builder initNewSkillTextComponent(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull String skillName, @NotNull SubSkillType subSkillType, boolean skillUnlocked) {
TextComponent.Builder textComponent;
if (skillUnlocked) {
if (RankUtils.getHighestRank(subSkillType) == RankUtils.getRank(mmoPlayer, subSkillType) && subSkillType.getNumRanks() > 1)
@@ -299,12 +299,12 @@ public class TextComponentFactory {
return textComponent;
}
private static Component getSubSkillHoverComponent(@NotNull McMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
private static Component getSubSkillHoverComponent(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull AbstractSubSkill abstractSubSkill)
{
return getSubSkillHoverEventJSON(abstractSubSkill, mmoPlayer);
}
private static Component getSubSkillHoverComponent(@NotNull McMMOPlayer mmoPlayer, SubSkillType subSkillType)
private static Component getSubSkillHoverComponent(@NotNull OnlineMMOPlayer mmoPlayer, SubSkillType subSkillType)
{
return getSubSkillHoverEventJSON(subSkillType, mmoPlayer);
}
@@ -315,7 +315,7 @@ public class TextComponentFactory {
* @param mmoPlayer the player who owns this subskill
* @return the hover basecomponent object for this subskill
*/
private static Component getSubSkillHoverEventJSON(@NotNull AbstractSubSkill abstractSubSkill, @NotNull McMMOPlayer mmoPlayer)
private static Component getSubSkillHoverEventJSON(@NotNull AbstractSubSkill abstractSubSkill, @NotNull OnlineMMOPlayer mmoPlayer)
{
String skillName = abstractSubSkill.getNiceName();
@@ -363,7 +363,7 @@ public class TextComponentFactory {
return componentBuilder.build();
}
private static TextComponent.Builder setupSkillComponentNameStyle(@NotNull McMMOPlayer mmoPlayer, @NotNull String skillName, @NotNull SubSkillType subSkillType, boolean skillUnlocked) {
private static TextComponent.Builder setupSkillComponentNameStyle(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull String skillName, @NotNull SubSkillType subSkillType, boolean skillUnlocked) {
TextComponent.Builder componentBuilder;
if (skillUnlocked) {
if (RankUtils.getHighestRank(subSkillType) == RankUtils.getRank(mmoPlayer, subSkillType) && subSkillType.getNumRanks() > 1)
@@ -417,7 +417,7 @@ public class TextComponentFactory {
}
@Deprecated
private static @NotNull Component getSubSkillHoverEventJSON(@NotNull SubSkillType subSkillType, @NotNull McMMOPlayer mmoPlayer)
private static @NotNull Component getSubSkillHoverEventJSON(@NotNull SubSkillType subSkillType, @NotNull OnlineMMOPlayer mmoPlayer)
{
String skillName = subSkillType.getLocaleName();
@@ -485,7 +485,7 @@ public class TextComponentFactory {
componentBuilder.append(Component.newline());
}
public static void getSubSkillTextComponents(@NotNull McMMOPlayer mmoPlayer, @NotNull List<Component> textComponents, @NotNull PrimarySkillType parentSkill) {
public static void getSubSkillTextComponents(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull List<Component> textComponents, @NotNull PrimarySkillType parentSkill) {
for(SubSkillType subSkillType : SubSkillType.values())
{
if(subSkillType.getParentSkill() == parentSkill)
@@ -514,7 +514,7 @@ public class TextComponentFactory {
}
}
public static @NotNull TextComponent getSubSkillUnlockedNotificationComponents(@NotNull McMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
public static @NotNull TextComponent getSubSkillUnlockedNotificationComponents(@NotNull OnlineMMOPlayer mmoPlayer, @NotNull SubSkillType subSkillType)
{
TextComponent.Builder unlockMessage = Component.text().content(LocaleLoader.getString("JSON.SkillUnlockMessage", subSkillType.getLocaleName(), RankUtils.getRank(mmoPlayer, subSkillType)));
unlockMessage.hoverEvent(HoverEvent.showText(getSubSkillHoverComponent(mmoPlayer, subSkillType)));