Create api module, McMMOPlayer -> BukkitMMOPlayer

This commit is contained in:
Shane Freeder 2019-10-05 02:55:03 +01:00
parent d2028321d4
commit a84a9e9c38
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
86 changed files with 269 additions and 254 deletions

View File

@ -0,0 +1,3 @@
plugins {
`java-library`
}

View File

@ -0,0 +1,7 @@
package com.gmail.nossr50.mcmmo.api.data;
public interface MMOPlayer<N> {
N getPlayer();
}

View File

@ -38,6 +38,7 @@ tasks {
dependencies {
api(project(":mcmmo-api"))
api("org.apache.tomcat:tomcat-jdbc:7.0.52")
api("com.typesafe:config:1.3.2")
api("org.spongepowered:configurate-core:3.7-SNAPSHOT")

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.chat;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
import com.gmail.nossr50.mcMMO;
@ -84,7 +84,7 @@ public class ChatManager {
/*
* Party Chat Spying
*/
for (McMMOPlayer mcMMOPlayer : pluginRef.getUserManager().getPlayers()) {
for (BukkitMMOPlayer mcMMOPlayer : pluginRef.getUserManager().getPlayers()) {
Player player = mcMMOPlayer.getPlayer();
//Check for toggled players

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
@ -21,7 +21,7 @@ public class AbilityToggleCommand extends ToggleCommand {
}
@Override
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
protected void applyCommandAction(BukkitMMOPlayer mcMMOPlayer) {
mcMMOPlayer.getPlayer().sendMessage(pluginRef.getLocaleManager().getString("Commands.Ability." + (mcMMOPlayer.getAllowAbilityUse() ? "Off" : "On")));
mcMMOPlayer.toggleAbilityUse();
}

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
@ -26,7 +26,7 @@ public class ChatNotificationToggleCommand implements TabExecutor {
switch (args.length) {
case 0:
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer((Player) sender);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer((Player) sender);
//Not Loaded yet
if (mcMMOPlayer == null)

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
@ -21,7 +21,7 @@ public class GodModeCommand extends ToggleCommand {
}
@Override
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
protected void applyCommandAction(BukkitMMOPlayer mcMMOPlayer) {
mcMMOPlayer.getPlayer().sendMessage(pluginRef.getLocaleManager().getString("Commands.GodMode." + (mcMMOPlayer.getGodMode() ? "Disabled" : "Enabled")));
mcMMOPlayer.toggleGodMode();
}

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
@ -21,7 +21,7 @@ public class RefreshCooldownsCommand extends ToggleCommand {
}
@Override
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
protected void applyCommandAction(BukkitMMOPlayer mcMMOPlayer) {
mcMMOPlayer.setRecentlyHurt(0);
mcMMOPlayer.resetCooldowns();
mcMMOPlayer.resetToolPrepMode();

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.commands;
import com.gmail.nossr50.database.FlatFileDatabaseManager;
import com.gmail.nossr50.database.SQLDatabaseManager;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
@ -24,7 +24,7 @@ public class ResetUserHealthBarSettingsCommand implements TabExecutor {
if (pluginRef.getDatabaseManager() instanceof SQLDatabaseManager) {
SQLDatabaseManager sqlDatabaseManager = (SQLDatabaseManager) pluginRef.getDatabaseManager();
sqlDatabaseManager.resetMobHealthSettings();
for (McMMOPlayer player : pluginRef.getUserManager().getPlayers()) {
for (BukkitMMOPlayer player : pluginRef.getUserManager().getPlayers()) {
player.getProfile().setMobHealthbarType(pluginRef.getConfigManager().getConfigMobs().getCombat().getHealthBars().getDisplayBarType());
}
sender.sendMessage("Mob health reset");
@ -33,7 +33,7 @@ public class ResetUserHealthBarSettingsCommand implements TabExecutor {
if (pluginRef.getDatabaseManager() instanceof FlatFileDatabaseManager) {
FlatFileDatabaseManager flatFileDatabaseManager = (FlatFileDatabaseManager) pluginRef.getDatabaseManager();
flatFileDatabaseManager.resetMobHealthSettings();
for (McMMOPlayer player : pluginRef.getUserManager().getPlayers()) {
for (BukkitMMOPlayer player : pluginRef.getUserManager().getPlayers()) {
player.getProfile().setMobHealthbarType(pluginRef.getConfigManager().getConfigMobs().getCombat().getHealthBars().getDisplayBarType());
}
sender.sendMessage("Mob health reset");

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
@ -46,7 +46,7 @@ public abstract class ToggleCommand implements TabExecutor {
}
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(playerName);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(playerName);
if (!pluginRef.getCommandTools().checkPlayerExistence(sender, playerName, mcMMOPlayer)) {
return true;
@ -81,7 +81,7 @@ public abstract class ToggleCommand implements TabExecutor {
protected abstract boolean hasSelfPermission(CommandSender sender);
protected abstract void applyCommandAction(McMMOPlayer mcMMOPlayer);
protected abstract void applyCommandAction(BukkitMMOPlayer mcMMOPlayer);
protected abstract void sendSuccessMessage(CommandSender sender, String playerName);
}

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands.admin;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -18,7 +18,7 @@ public class PlayerDebugCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(sender instanceof Player) {
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer((Player) sender);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer((Player) sender);
mcMMOPlayer.toggleDebugMode(); //Toggle debug mode
pluginRef.getNotificationManager().sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.Mmodebug.Toggle", String.valueOf(mcMMOPlayer.isDebugMode()));
return true;

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.commands.chat;
import com.gmail.nossr50.commands.CommandConstants;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
@ -26,7 +26,7 @@ public abstract class ChatCommand implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
McMMOPlayer mcMMOPlayer;
BukkitMMOPlayer mcMMOPlayer;
switch (args.length) {
case 0:
@ -109,7 +109,7 @@ public abstract class ChatCommand implements TabExecutor {
protected abstract void handleChatSending(CommandSender sender, String[] args);
private void enableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
private void enableChatMode(BukkitMMOPlayer mcMMOPlayer, CommandSender sender) {
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.None"));
return;
@ -124,7 +124,7 @@ public abstract class ChatCommand implements TabExecutor {
sender.sendMessage(getChatModeEnabledMessage(chatMode, true));
}
private void disableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
private void disableChatMode(BukkitMMOPlayer mcMMOPlayer, CommandSender sender) {
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.None"));
return;

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.chat;
import com.gmail.nossr50.commands.ToggleCommand;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
@ -22,7 +22,7 @@ public class ChatSpyCommand extends ToggleCommand {
}
@Override
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
protected void applyCommandAction(BukkitMMOPlayer mcMMOPlayer) {
mcMMOPlayer.getPlayer().sendMessage(pluginRef.getLocaleManager().getString("Commands.AdminChatSpy." + (mcMMOPlayer.isPartyChatSpying() ? "Disabled" : "Enabled")));
mcMMOPlayer.togglePartyChatSpying();
}

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
@ -96,7 +96,7 @@ public abstract class ExperienceCommand implements TabExecutor {
int value = Integer.parseInt(args[2]);
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
@ -81,7 +81,7 @@ public class SkillResetCommand implements TabExecutor {
}
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -26,7 +26,7 @@ public class PartyAcceptCommand implements CommandExecutor {
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (!mcMMOPlayer.hasPartyInvite()) {

View File

@ -5,7 +5,7 @@ import com.gmail.nossr50.commands.chat.PartyChatCommand;
import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand;
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
@ -110,7 +110,7 @@ public class PartyCommand implements TabExecutor {
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (args.length < 1) {
if (!mcMMOPlayer.inParty()) {

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -21,7 +21,7 @@ public class PartyCreateCommand implements CommandExecutor {
case 2:
case 3:
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (pluginRef.getUserManager().getPlayer(player) == null) {
player.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.ShareMode;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
import org.bukkit.ChatColor;
@ -33,7 +33,7 @@ public class PartyInfoCommand implements CommandExecutor {
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
Party party = mcMMOPlayer.getParty();
displayPartyHeader(player, party);
@ -133,7 +133,7 @@ public class PartyInfoCommand implements CommandExecutor {
}
}
private void displayMemberInfo(Player player, McMMOPlayer mcMMOPlayer, Party party) {
private void displayMemberInfo(Player player, BukkitMMOPlayer mcMMOPlayer, Party party) {
/*
* Only show members of the party that this member can see
*/

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -21,7 +21,7 @@ public class PartyInviteCommand implements CommandExecutor {
switch (args.length) {
case 2:
String targetName = pluginRef.getCommandTools().getMatchedPlayerName(args[1]);
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getOfflinePlayer(targetName);
BukkitMMOPlayer mcMMOTarget = pluginRef.getUserManager().getOfflinePlayer(targetName);
if (!pluginRef.getCommandTools().checkPlayerExistence(sender, targetName, mcMMOTarget)) {
return false;
@ -35,7 +35,7 @@ public class PartyInviteCommand implements CommandExecutor {
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
String playerName = player.getName();
if (player.equals(target)) {

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -22,7 +22,7 @@ public class PartyJoinCommand implements CommandExecutor {
case 2:
case 3:
String targetName = pluginRef.getCommandTools().getMatchedPlayerName(args[1]);
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetName);
BukkitMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetName);
if (!pluginRef.getCommandTools().checkPlayerExistence(sender, targetName, mcMMOTarget)) {
return true;
@ -42,7 +42,7 @@ public class PartyJoinCommand implements CommandExecutor {
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
Party targetParty = mcMMOTarget.getParty();
if (player.equals(target) || (mcMMOPlayer.inParty() && mcMMOPlayer.getParty().equals(targetParty))) {

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
@ -28,7 +28,7 @@ public class PartyQuitCommand implements CommandExecutor {
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
Party playerParty = mcMMOPlayer.getParty();
if (!pluginRef.getPartyManager().handlePartyChangeEvent(player, playerParty.getName(), null, EventReason.LEFT_PARTY)) {

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
@ -26,7 +26,7 @@ public class PartyRenameCommand implements CommandExecutor {
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer((Player) sender);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer((Player) sender);
Party playerParty = mcMMOPlayer.getParty();
String oldPartyName = playerParty.getName();

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands.party.alliance;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -24,7 +24,7 @@ public class PartyAllianceAcceptCommand implements CommandExecutor {
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (!mcMMOPlayer.hasPartyAllianceInvite()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.NoInvites"));

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.commands.party.alliance;
import com.gmail.nossr50.commands.CommandConstants;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.ChatColor;
@ -48,7 +48,7 @@ public class PartyAllianceCommand implements TabExecutor {
}
player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
playerParty = mcMMOPlayer.getParty();
@ -132,7 +132,7 @@ public class PartyAllianceCommand implements TabExecutor {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.Ally", playerParty.getName(), targetParty.getName()));
}
private void displayMemberInfo(McMMOPlayer mcMMOPlayer) {
private void displayMemberInfo(BukkitMMOPlayer mcMMOPlayer) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.Members.Header"));
player.sendMessage(playerParty.createMembersList(player));
player.sendMessage(ChatColor.DARK_GRAY + "----------------------------");

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.party.alliance;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -25,7 +25,7 @@ public class PartyAllianceDisbandCommand implements CommandExecutor {
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
Party party = mcMMOPlayer.getParty();
if (party.getAlly() == null) {

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.party.alliance;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -21,7 +21,7 @@ public class PartyAllianceInviteCommand implements CommandExecutor {
switch (args.length) {
case 3:
String targetName = pluginRef.getCommandTools().getMatchedPlayerName(args[2]);
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getOfflinePlayer(targetName);
BukkitMMOPlayer mcMMOTarget = pluginRef.getUserManager().getOfflinePlayer(targetName);
if (!pluginRef.getCommandTools().checkPlayerExistence(sender, targetName, mcMMOTarget)) {
return false;
@ -35,7 +35,7 @@ public class PartyAllianceInviteCommand implements CommandExecutor {
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
String playerName = player.getName();
if (player.equals(target)) {

View File

@ -4,7 +4,7 @@ import com.gmail.nossr50.commands.CommandConstants;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
@ -60,7 +60,7 @@ public class PtpCommand implements TabExecutor {
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (!mcMMOPlayer.inParty()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.None"));
@ -135,7 +135,7 @@ public class PtpCommand implements TabExecutor {
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (!mcMMOPlayer.inParty()) {
return ImmutableList.of();
@ -156,7 +156,7 @@ public class PtpCommand implements TabExecutor {
return;
}
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetName);
BukkitMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetName);
Player target = mcMMOTarget.getPlayer();
PartyTeleportRecord ptpRecord = mcMMOTarget.getPartyTeleportRecord();

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.scoreboards.SidebarType;
@ -47,7 +47,7 @@ public class CooldownCommand implements TabExecutor {
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Cooldowns.Header"));
player.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.NoSkillNote"));

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
@ -27,7 +27,7 @@ public class InspectCommand implements TabExecutor {
switch (args.length) {
case 1:
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.LeaderboardsCommandAsyncTask;
@ -90,7 +90,7 @@ public class LeaderboardCommand implements TabExecutor {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(sender.getName());
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(sender.getName());
long cooldownMillis = 5000;
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.RankCommandAsyncTask;
import com.gmail.nossr50.util.scoreboards.SidebarType;
@ -56,7 +56,7 @@ public class RankCommand implements TabExecutor {
}
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
if (mcMMOPlayer != null) {
Player player = mcMMOPlayer.getPlayer();
@ -89,7 +89,7 @@ public class RankCommand implements TabExecutor {
private void display(CommandSender sender, String playerName) {
if (sender instanceof Player) {
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(sender.getName());
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(sender.getName());
if (mcMMOPlayer == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
@ -120,7 +120,7 @@ public class RankCommand implements TabExecutor {
new RankCommandAsyncTask(pluginRef, playerName, sender, useBoard, useChat).runTaskAsynchronously(pluginRef);
}
private long getCDSeconds(McMMOPlayer mcMMOPlayer, long cooldownMillis) {
private long getCDSeconds(BukkitMMOPlayer mcMMOPlayer, long cooldownMillis) {
return ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis());
}
}

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
@ -63,7 +63,7 @@ public abstract class SkillCommand implements TabExecutor {
switch (args.length) {
case 0:
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
boolean isLucky = pluginRef.getPermissionTools().lucky(player, skill);
boolean hasEndurance = pluginRef.getSkillTools().getEnduranceLength(player) > 0;
@ -134,7 +134,7 @@ public abstract class SkillCommand implements TabExecutor {
player.sendMessage(pluginRef.getLocaleManager().getString("Guides.Available", skillName, skillName.toLowerCase()));
}
private void sendSkillCommandHeader(Player player, McMMOPlayer mcMMOPlayer, int skillValue) {
private void sendSkillCommandHeader(Player player, BukkitMMOPlayer mcMMOPlayer, int skillValue) {
ChatColor hd1 = ChatColor.DARK_AQUA;
ChatColor c1 = ChatColor.GOLD;
ChatColor c2 = ChatColor.RED;

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.datatypes.party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.ShareHandler;
import com.gmail.nossr50.util.StringUtils;
@ -503,7 +503,7 @@ public class Party {
* @param mcMMOPlayer The player to check
* @return the near party members
*/
public List<Player> getNearMembers(McMMOPlayer mcMMOPlayer) {
public List<Player> getNearMembers(BukkitMMOPlayer mcMMOPlayer) {
List<Player> nearMembers = new ArrayList<Player>();
Party party = mcMMOPlayer.getParty();

View File

@ -11,6 +11,7 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcmmo.api.data.MMOPlayer;
import com.gmail.nossr50.runnables.skills.AbilityDisableTask;
import com.gmail.nossr50.runnables.skills.ToolLowerTask;
import com.gmail.nossr50.skills.SkillManager;
@ -45,7 +46,7 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
public class McMMOPlayer {
public class BukkitMMOPlayer implements MMOPlayer<Player> {
private final mcMMO pluginRef;
private final Map<PrimarySkillType, SkillManager> skillManagerMap = new HashMap<>();
private final Map<SuperAbilityType, Boolean> superAbilityModeMap = new HashMap<>();
@ -78,7 +79,7 @@ public class McMMOPlayer {
private HashMap<PrimarySkillType, Double> personalXPModifiers;
private String playerName;
public McMMOPlayer(Player player, PlayerProfile profile, mcMMO pluginRef) {
public BukkitMMOPlayer(Player player, PlayerProfile profile, mcMMO pluginRef) {
this.pluginRef = pluginRef;
this.playerName = player.getName();
UUID uuid = player.getUniqueId();
@ -693,6 +694,7 @@ public class McMMOPlayer {
* Players & Profiles
*/
@Override
public Player getPlayer() {
return player;
}

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.datatypes.skills.subskills.acrobatics;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
@ -60,7 +60,7 @@ public class Roll extends AcrobaticsSubSkill {
case FALL:
//Grab the player
McMMOPlayer mcMMOPlayer = pluginRef.getEventManager().getMcMMOPlayer(entityDamageEvent.getEntity());
BukkitMMOPlayer mcMMOPlayer = pluginRef.getEventManager().getMcMMOPlayer(entityDamageEvent.getEntity());
if (mcMMOPlayer == null)
break;
@ -186,7 +186,7 @@ public class Roll extends AcrobaticsSubSkill {
* @param damage The amount of damage initially dealt by the event
* @return the modified event damage if the ability was successful, the original event damage otherwise
*/
private double rollCheck(Player player, McMMOPlayer mcMMOPlayer, double damage) {
private double rollCheck(Player player, BukkitMMOPlayer mcMMOPlayer, double damage) {
int skillLevel = mcMMOPlayer.getSkillLevel(getPrimarySkill());
@ -219,7 +219,7 @@ public class Roll extends AcrobaticsSubSkill {
return damage;
}
private int getActivationChance(McMMOPlayer mcMMOPlayer) {
private int getActivationChance(BukkitMMOPlayer mcMMOPlayer) {
return pluginRef.getPerkUtils().handleLuckyPerks(mcMMOPlayer.getPlayer(), getPrimarySkill());
}
@ -229,7 +229,7 @@ public class Roll extends AcrobaticsSubSkill {
* @param damage The amount of damage initially dealt by the event
* @return the modified event damage if the ability was successful, the original event damage otherwise
*/
private double gracefulRollCheck(Player player, McMMOPlayer mcMMOPlayer, double damage, int skillLevel) {
private double gracefulRollCheck(Player player, BukkitMMOPlayer mcMMOPlayer, double damage, int skillLevel) {
double modifiedDamage = calculateModifiedRollDamage(damage, pluginRef.getConfigManager().getConfigAcrobatics().getRollDamageThreshold() * 2);
RandomChanceSkill rcs = new RandomChanceSkill(pluginRef, player, subSkillType);
@ -270,7 +270,7 @@ public class Roll extends AcrobaticsSubSkill {
return false;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (pluginRef.getItemTools().hasItemInEitherHand(player, Material.ENDER_PEARL) || player.isInsideVehicle()) {
if(mcMMOPlayer.isDebugMode()) {

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.listeners;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.meta.BonusDropMeta;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.datatypes.skills.ToolType;
@ -174,7 +174,7 @@ public class BlockListener implements Listener {
pluginRef.getPlaceStore().setTrue(blockState);
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (mcMMOPlayer == null)
return;
@ -273,7 +273,7 @@ public class BlockListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
//Check if profile is loaded
if (mcMMOPlayer == null)
@ -427,7 +427,7 @@ public class BlockListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
//Profile not loaded
if (mcMMOPlayer == null) {
@ -500,7 +500,7 @@ public class BlockListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
//Profile not loaded
if (pluginRef.getUserManager().getPlayer(player) == null) {

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.listeners;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.interfaces.InteractType;
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
@ -493,7 +493,7 @@ public class EntityListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
//Profile not loaded
if (mcMMOPlayer == null)

View File

@ -4,7 +4,7 @@ import com.gmail.nossr50.chat.ChatManager;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
@ -192,7 +192,7 @@ public class PlayerListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
mcMMOPlayer.checkGodMode();
mcMMOPlayer.checkParty();
@ -436,7 +436,7 @@ public class PlayerListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
Item drop = event.getItem();
//Remove tracking
@ -495,7 +495,7 @@ public class PlayerListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
//There's an issue with using Async saves on player quit
//Basically there are conditions in which an async task does not execute fast enough to save the data if the server shutdown shortly after this task was scheduled
mcMMOPlayer.logout(true);
@ -588,7 +588,7 @@ public class PlayerListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
MiningManager miningManager = mcMMOPlayer.getMiningManager();
Block block = event.getClickedBlock();
ItemStack heldItem = player.getInventory().getItemInMainHand();
@ -704,7 +704,7 @@ public class PlayerListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
ItemStack heldItem = player.getInventory().getItemInMainHand();
//Spam Fishing Detection
@ -843,7 +843,7 @@ public class PlayerListener implements Listener {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(player);
if (mcMMOPlayer == null) {
pluginRef.debug(player.getName() + "is chatting, but is currently not logged in to the server.");

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.listeners;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
@ -58,7 +58,7 @@ public class SelfListener implements Listener {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerXpGain(McMMOPlayerXpGainEvent event) {
Player player = event.getPlayer();
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
PrimarySkillType primarySkillType = event.getSkill();
if(mcMMOPlayer.isDebugMode()) {

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.party;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.party.*;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
@ -34,7 +34,7 @@ public final class PartyManager {
}
public boolean canTeleport(CommandSender sender, Player player, String targetName) {
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetName);
BukkitMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetName);
if (!pluginRef.getCommandTools().checkPlayerExistence(sender, targetName, mcMMOTarget)) {
return false;
@ -76,8 +76,8 @@ public final class PartyManager {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(teleportingPlayer);
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetPlayer);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(teleportingPlayer);
BukkitMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetPlayer);
long warmup = pluginRef.getConfigManager().getConfigParty().getPTP().getPtpWarmup();
@ -139,7 +139,7 @@ public final class PartyManager {
* @param newPartyName The name of the party being joined
* @return true if the party was joined successfully, false otherwise
*/
public boolean changeOrJoinParty(McMMOPlayer mcMMOPlayer, String newPartyName) {
public boolean changeOrJoinParty(BukkitMMOPlayer mcMMOPlayer, String newPartyName) {
Player player = mcMMOPlayer.getPlayer();
if (mcMMOPlayer.inParty()) {
@ -218,7 +218,7 @@ public final class PartyManager {
* @param mcMMOPlayer The player to check
* @return the near party members
*/
public List<Player> getNearMembers(McMMOPlayer mcMMOPlayer) {
public List<Player> getNearMembers(BukkitMMOPlayer mcMMOPlayer) {
List<Player> nearMembers = new ArrayList<>();
Party party = mcMMOPlayer.getParty();
@ -236,7 +236,7 @@ public final class PartyManager {
return nearMembers;
}
public List<Player> getNearVisibleMembers(McMMOPlayer mcMMOPlayer) {
public List<Player> getNearVisibleMembers(BukkitMMOPlayer mcMMOPlayer) {
List<Player> nearMembers = new ArrayList<>();
Party party = mcMMOPlayer.getParty();
@ -373,7 +373,7 @@ public final class PartyManager {
return null;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
return mcMMOPlayer.getParty();
}
@ -420,7 +420,7 @@ public final class PartyManager {
*
* @param mcMMOPlayer The player to remove
*/
public void removeFromParty(McMMOPlayer mcMMOPlayer) {
public void removeFromParty(BukkitMMOPlayer mcMMOPlayer) {
removeFromParty(mcMMOPlayer.getPlayer(), mcMMOPlayer.getParty());
processPartyLeaving(mcMMOPlayer);
}
@ -456,7 +456,7 @@ public final class PartyManager {
* @param partyName The party to add the player to
* @param password The password for this party, null if there was no password
*/
public void createParty(McMMOPlayer mcMMOPlayer, String partyName, String password) {
public void createParty(BukkitMMOPlayer mcMMOPlayer, String partyName, String password) {
Player player = mcMMOPlayer.getPlayer();
Party party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName.replace(".", ""), password, pluginRef);
@ -507,7 +507,7 @@ public final class PartyManager {
*
* @param mcMMOPlayer The player to add to the party
*/
public void joinInvitedParty(McMMOPlayer mcMMOPlayer) {
public void joinInvitedParty(BukkitMMOPlayer mcMMOPlayer) {
Party invite = mcMMOPlayer.getPartyInvite();
// Check if the party still exists, it might have been disbanded
@ -536,7 +536,7 @@ public final class PartyManager {
*
* @param mcMMOPlayer The player who accepts the alliance invite
*/
public void acceptAllianceInvite(McMMOPlayer mcMMOPlayer) {
public void acceptAllianceInvite(BukkitMMOPlayer mcMMOPlayer) {
Party invite = mcMMOPlayer.getPartyAllianceInvite();
Player player = mcMMOPlayer.getPlayer();
@ -592,7 +592,7 @@ public final class PartyManager {
* @param mcMMOPlayer The player to add to the party
* @param party The party
*/
public void addToParty(McMMOPlayer mcMMOPlayer, Party party) {
public void addToParty(BukkitMMOPlayer mcMMOPlayer, Party party) {
Player player = mcMMOPlayer.getPlayer();
String playerName = player.getName();
@ -644,7 +644,7 @@ public final class PartyManager {
*
* @return true if the player can invite
*/
public boolean canInvite(McMMOPlayer mcMMOPlayer) {
public boolean canInvite(BukkitMMOPlayer mcMMOPlayer) {
Party party = mcMMOPlayer.getParty();
return !party.isLocked() || party.getLeader().getUniqueId().equals(mcMMOPlayer.getPlayer().getUniqueId());
@ -868,7 +868,7 @@ public final class PartyManager {
*
* @param mcMMOPlayer The player to remove party data from.
*/
public void processPartyLeaving(McMMOPlayer mcMMOPlayer) {
public void processPartyLeaving(BukkitMMOPlayer mcMMOPlayer) {
mcMMOPlayer.removeParty();
mcMMOPlayer.disableChat(ChatMode.PARTY);
mcMMOPlayer.setItemShareModifier(10);

View File

@ -5,7 +5,7 @@ import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.party.ItemShareType;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.ShareMode;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.Material;
@ -32,7 +32,7 @@ public final class ShareHandler {
* @param primarySkillType Skill being used
* @return True is the xp has been shared
*/
public boolean handleXpShare(double xp, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, XPGainReason xpGainReason) {
public boolean handleXpShare(double xp, BukkitMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, XPGainReason xpGainReason) {
if (party.getXpShareMode() != ShareMode.EQUAL) {
return false;
}
@ -70,7 +70,7 @@ public final class ShareHandler {
* @param mcMMOPlayer Player who picked up the item
* @return True if the item has been shared
*/
public boolean handleItemShare(Item drop, McMMOPlayer mcMMOPlayer) {
public boolean handleItemShare(Item drop, BukkitMMOPlayer mcMMOPlayer) {
ItemStack itemStack = drop.getItemStack();
ItemShareType dropType = getShareType(itemStack);
@ -111,7 +111,7 @@ public final class ShareHandler {
int highestRoll = 0;
for (Player member : nearMembers) {
McMMOPlayer mcMMOMember = pluginRef.getUserManager().getPlayer(member);
BukkitMMOPlayer mcMMOMember = pluginRef.getUserManager().getPlayer(member);
//Profile not loaded
if (pluginRef.getUserManager().getPlayer(member) == null) {
@ -129,14 +129,14 @@ public final class ShareHandler {
highestRoll = diceRoll;
if (winningPlayer != null) {
McMMOPlayer mcMMOWinning = pluginRef.getUserManager().getPlayer(winningPlayer);
BukkitMMOPlayer mcMMOWinning = pluginRef.getUserManager().getPlayer(winningPlayer);
mcMMOWinning.setItemShareModifier(mcMMOWinning.getItemShareModifier() + itemWeight);
}
winningPlayer = member;
}
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(winningPlayer);
BukkitMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(winningPlayer);
mcMMOTarget.setItemShareModifier(mcMMOTarget.getItemShareModifier() - itemWeight);
awardDrop(winningPlayer, newStack);
}

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.runnables;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask;
import org.bukkit.scheduler.BukkitRunnable;
@ -18,7 +18,7 @@ public class SaveTimerTask extends BukkitRunnable {
// All player data will be saved periodically through this
int count = 1;
for (McMMOPlayer mcMMOPlayer : pluginRef.getUserManager().getPlayers()) {
for (BukkitMMOPlayer mcMMOPlayer : pluginRef.getUserManager().getPlayers()) {
new PlayerProfileSaveTask(mcMMOPlayer.getProfile(), false).runTaskLaterAsynchronously(pluginRef, count);
count++;
}

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.runnables.database;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
@ -32,7 +32,7 @@ public class FormulaConversionTask extends BukkitRunnable {
int convertedUsers = 0;
long startMillis = System.currentTimeMillis();
for (String playerName : pluginRef.getDatabaseManager().getStoredUsers()) {
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
PlayerProfile profile;
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.runnables.items;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ChimaeraWing;
import org.bukkit.Location;
@ -10,9 +10,9 @@ import org.bukkit.scheduler.BukkitRunnable;
public class ChimaeraWingWarmup extends BukkitRunnable {
private mcMMO pluginRef;
private McMMOPlayer mcMMOPlayer;
private BukkitMMOPlayer mcMMOPlayer;
public ChimaeraWingWarmup(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public ChimaeraWingWarmup(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
this.pluginRef = pluginRef;
this.mcMMOPlayer = mcMMOPlayer;
}

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.runnables.items;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -8,10 +8,10 @@ import org.bukkit.scheduler.BukkitRunnable;
public class TeleportationWarmup extends BukkitRunnable {
private final mcMMO pluginRef;
private McMMOPlayer mcMMOPlayer;
private McMMOPlayer mcMMOTarget;
private BukkitMMOPlayer mcMMOPlayer;
private BukkitMMOPlayer mcMMOTarget;
public TeleportationWarmup(mcMMO pluginRef, McMMOPlayer mcMMOPlayer, McMMOPlayer mcMMOTarget) {
public TeleportationWarmup(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer, BukkitMMOPlayer mcMMOTarget) {
this.pluginRef = pluginRef;
this.mcMMOPlayer = mcMMOPlayer;
this.mcMMOTarget = mcMMOTarget;

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.runnables.player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.scheduler.BukkitRunnable;
@ -14,7 +14,7 @@ public class ClearRegisteredXPGainTask extends BukkitRunnable {
@Override
public void run() {
for (McMMOPlayer mcMMOPlayer : pluginRef.getUserManager().getPlayers()) {
for (BukkitMMOPlayer mcMMOPlayer : pluginRef.getUserManager().getPlayers()) {
mcMMOPlayer.getProfile().purgeExpiredXpGains();
}
}

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.runnables.player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.ScoreboardKeepTask;
@ -42,7 +42,7 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
PlayerProfile profile = pluginRef.getDatabaseManager().loadPlayerProfile(player.getName(), player.getUniqueId(), true);
// If successful, schedule the apply
if (profile.isLoaded()) {
new ApplySuccessfulProfile(new McMMOPlayer(player, profile, pluginRef)).runTask(pluginRef);
new ApplySuccessfulProfile(new BukkitMMOPlayer(player, profile, pluginRef)).runTask(pluginRef);
pluginRef.getEventManager().callPlayerProfileLoadEvent(player, profile);
return;
}
@ -67,9 +67,9 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
}
private class ApplySuccessfulProfile extends BukkitRunnable {
private final McMMOPlayer mcMMOPlayer;
private final BukkitMMOPlayer mcMMOPlayer;
private ApplySuccessfulProfile(McMMOPlayer mcMMOPlayer) {
private ApplySuccessfulProfile(BukkitMMOPlayer mcMMOPlayer) {
this.mcMMOPlayer = mcMMOPlayer;
}

View File

@ -1,17 +1,17 @@
package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.scheduler.BukkitRunnable;
public class AbilityCooldownTask extends BukkitRunnable {
private final mcMMO pluginRef;
private final McMMOPlayer mcMMOPlayer;
private final BukkitMMOPlayer mcMMOPlayer;
private final SuperAbilityType superAbilityType;
public AbilityCooldownTask(mcMMO pluginRef, McMMOPlayer mcMMOPlayer, SuperAbilityType superAbilityType) {
public AbilityCooldownTask(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer, SuperAbilityType superAbilityType) {
this.pluginRef = pluginRef;
this.mcMMOPlayer = mcMMOPlayer;
this.superAbilityType = superAbilityType;

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.Chunk;
@ -11,10 +11,10 @@ import org.bukkit.scheduler.BukkitRunnable;
public class AbilityDisableTask extends BukkitRunnable {
private final mcMMO pluginRef;
private McMMOPlayer mcMMOPlayer;
private BukkitMMOPlayer mcMMOPlayer;
private SuperAbilityType superAbilityType;
public AbilityDisableTask(mcMMO pluginRef, McMMOPlayer mcMMOPlayer, SuperAbilityType superAbilityType) {
public AbilityDisableTask(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer, SuperAbilityType superAbilityType) {
this.pluginRef = pluginRef;
this.mcMMOPlayer = mcMMOPlayer;
this.superAbilityType = superAbilityType;

View File

@ -2,21 +2,21 @@ package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.scheduler.BukkitRunnable;
//TODO: Why is this a task? Investigate later.
public class AwardCombatXpTask extends BukkitRunnable {
private McMMOPlayer mcMMOPlayer;
private BukkitMMOPlayer mcMMOPlayer;
private double baseXp;
private PrimarySkillType primarySkillType;
private LivingEntity target;
private XPGainReason xpGainReason;
private double baseHealth;
public AwardCombatXpTask(McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, double baseXp, LivingEntity target, XPGainReason xpGainReason) {
public AwardCombatXpTask(BukkitMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, double baseXp, LivingEntity target, XPGainReason xpGainReason) {
this.mcMMOPlayer = mcMMOPlayer;
this.primarySkillType = primarySkillType;
this.baseXp = baseXp;

View File

@ -1,17 +1,17 @@
package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.BlockSnapshot;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.ArrayList;
public class DelayedHerbalismXPCheckTask extends BukkitRunnable {
private final McMMOPlayer mcMMOPlayer;
private final BukkitMMOPlayer mcMMOPlayer;
private final ArrayList<BlockSnapshot> chorusBlocks;
public DelayedHerbalismXPCheckTask(McMMOPlayer mcMMOPlayer, ArrayList<BlockSnapshot> chorusBlocks) {
public DelayedHerbalismXPCheckTask(BukkitMMOPlayer mcMMOPlayer, ArrayList<BlockSnapshot> chorusBlocks) {
this.mcMMOPlayer = mcMMOPlayer;
this.chorusBlocks = chorusBlocks;
}

View File

@ -1,16 +1,16 @@
package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.util.experience.ExperienceBarManager;
import org.bukkit.scheduler.BukkitRunnable;
public class ExperienceBarHideTask extends BukkitRunnable {
private final McMMOPlayer mcMMOPlayer;
private final BukkitMMOPlayer mcMMOPlayer;
private final PrimarySkillType primarySkillType;
private final ExperienceBarManager experienceBarManagerRef;
public ExperienceBarHideTask(ExperienceBarManager experienceBarManagerRef, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType) {
public ExperienceBarHideTask(ExperienceBarManager experienceBarManagerRef, BukkitMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType) {
this.experienceBarManagerRef = experienceBarManagerRef;
this.mcMMOPlayer = mcMMOPlayer;
this.primarySkillType = primarySkillType;

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.scheduler.BukkitRunnable;
@ -8,7 +8,7 @@ import org.bukkit.scheduler.BukkitRunnable;
public class SkillUnlockNotificationTask extends BukkitRunnable {
private final mcMMO pluginRef;
private final McMMOPlayer mcMMOPlayer;
private final BukkitMMOPlayer mcMMOPlayer;
private final SubSkillType subSkillType;
/**
@ -17,7 +17,7 @@ public class SkillUnlockNotificationTask extends BukkitRunnable {
* @param mcMMOPlayer target player
* @param subSkillType the subskill that they just unlocked
*/
public SkillUnlockNotificationTask(mcMMO pluginRef, McMMOPlayer mcMMOPlayer, SubSkillType subSkillType) {
public SkillUnlockNotificationTask(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer, SubSkillType subSkillType) {
this.pluginRef = pluginRef;
this.mcMMOPlayer = mcMMOPlayer;
this.subSkillType = subSkillType;

View File

@ -1,17 +1,17 @@
package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.scheduler.BukkitRunnable;
public class ToolLowerTask extends BukkitRunnable {
private final mcMMO pluginRef;
private final McMMOPlayer mcMMOPlayer;
private final BukkitMMOPlayer mcMMOPlayer;
private final ToolType tool;
public ToolLowerTask(mcMMO pluginRef, McMMOPlayer mcMMOPlayer, ToolType tool) {
public ToolLowerTask(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer, ToolType tool) {
this.pluginRef = pluginRef;
this.mcMMOPlayer = mcMMOPlayer;
this.tool = tool;

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.skills;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.entity.Entity;
@ -10,11 +10,11 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
public abstract class SkillManager {
protected McMMOPlayer mcMMOPlayer;
protected BukkitMMOPlayer mcMMOPlayer;
protected PrimarySkillType skill;
protected final mcMMO pluginRef;
public SkillManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer, PrimarySkillType skill) {
public SkillManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer, PrimarySkillType skill) {
this.pluginRef = pluginRef;
this.mcMMOPlayer = mcMMOPlayer;
this.skill = skill;

View File

@ -4,7 +4,7 @@ import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.LimitedSizeList;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.behaviours.AcrobaticsBehaviour;
@ -26,7 +26,7 @@ public class AcrobaticsManager extends SkillManager {
private LimitedSizeList fallLocationMap;
private AcrobaticsBehaviour acrobaticsBehaviour;
public AcrobaticsManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public AcrobaticsManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.ACROBATICS);
//Init Behaviour
acrobaticsBehaviour = pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getAcrobaticsBehaviour();

View File

@ -1,13 +1,13 @@
package com.gmail.nossr50.skills.alchemy;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager;
public class AlchemyManager extends SkillManager {
public AlchemyManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public AlchemyManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.ALCHEMY);
}

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.skills.archery;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.behaviours.ArcheryBehaviour;
@ -21,7 +21,7 @@ public class ArcheryManager extends SkillManager {
private final ArcheryBehaviour archeryBehaviour;
public ArcheryManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public ArcheryManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.ARCHERY);
//Init Behaviour

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.skills.axes;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@ -22,7 +22,7 @@ public class AxesManager extends SkillManager {
private final AxesBehaviour axesBehaviour;
public AxesManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public AxesManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.AXES);
this.axesBehaviour = pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getAxesBehaviour();
}

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.skills.excavation;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.behaviours.ExcavationBehaviour;
@ -14,7 +14,7 @@ public class ExcavationManager extends SkillManager {
private final ExcavationBehaviour excavationBehaviour;
public ExcavationManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public ExcavationManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.EXCAVATION);
this.excavationBehaviour = pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getExcavationBehaviour();
}

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.skills.fishing;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.behaviours.FishingBehaviour;
@ -39,7 +39,7 @@ public class FishingManager extends SkillManager {
private int overFishCount;
private FishingBehaviour fishingBehaviour;
public FishingManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public FishingManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.FISHING);
fishingBehaviour = pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getFishingBehaviour();

View File

@ -5,7 +5,7 @@ import com.gmail.nossr50.datatypes.BlockSnapshot;
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.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@ -37,7 +37,7 @@ public class HerbalismManager extends SkillManager {
private final HerbalismBehaviour herbalismBehaviour;
public HerbalismManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public HerbalismManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.HERBALISM);
herbalismBehaviour = pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getHerbalismBehaviour();
}

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.skills.mining;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@ -26,7 +26,7 @@ public class MiningManager extends SkillManager {
private final MiningBehaviour miningBehaviour;
public MiningManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public MiningManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.MINING);
//Init behaviour

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.skills.repair;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
@ -20,7 +20,7 @@ public class RepairManager extends SkillManager {
private boolean placedAnvil;
private int lastClick;
public RepairManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public RepairManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.REPAIR);
}

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.skills.salvage;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.behaviours.SalvageBehaviour;
@ -24,7 +24,7 @@ public class SalvageManager extends SkillManager {
private int lastClick;
private SalvageBehaviour salvageBehaviour;
public SalvageManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public SalvageManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.SALVAGE);
this.salvageBehaviour = pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getSalvageBehaviour();
}

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.skills.smelting;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
@ -12,7 +12,7 @@ import org.bukkit.event.inventory.FurnaceBurnEvent;
import org.bukkit.inventory.ItemStack;
public class SmeltingManager extends SkillManager {
public SmeltingManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public SmeltingManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.SMELTING);
}

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.skills.swords;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@ -18,7 +18,7 @@ import org.bukkit.inventory.ItemStack;
import java.util.Map;
public class SwordsManager extends SkillManager {
public SwordsManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public SwordsManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.SWORDS);
}

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.skills.taming;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.behaviours.TamingBehaviour;
@ -32,7 +32,7 @@ public class TamingManager extends SkillManager {
private HashMap<CallOfTheWildType, List<TrackedTamingEntity>> playerSummonedEntities;
public TamingManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public TamingManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.TAMING);
init();
}

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.skills.unarmed;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@ -22,7 +22,7 @@ public class UnarmedManager extends SkillManager {
private long attackInterval;
public double berserkDamageModifier = 1.5;
public UnarmedManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public UnarmedManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.UNARMED);
initUnarmedPerPlayerVars();
}

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.skills.woodcutting;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@ -27,7 +27,7 @@ public class WoodcuttingManager extends SkillManager {
private final WoodcuttingBehaviour woodcuttingBehaviour;
private boolean treeFellerReachedThreshold;
public WoodcuttingManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public WoodcuttingManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
super(pluginRef, mcMMOPlayer, PrimarySkillType.WOODCUTTING);
this.treeFellerReachedThreshold = false;
this.woodcuttingBehaviour = pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getWoodcuttingBehaviour();

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.util;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.items.ChimaeraWingWarmup;
import com.gmail.nossr50.util.sounds.SoundType;
@ -13,11 +13,11 @@ import org.bukkit.util.Vector;
public final class ChimaeraWing {
private final mcMMO pluginRef;
private final McMMOPlayer mcMMOPlayer;
private final BukkitMMOPlayer mcMMOPlayer;
private final Player player;
private final Location location;
public ChimaeraWing(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public ChimaeraWing(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
this.pluginRef = pluginRef;
this.mcMMOPlayer = mcMMOPlayer;
this.player = mcMMOPlayer.getPlayer();

View File

@ -4,7 +4,7 @@ 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.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
@ -78,7 +78,7 @@ public class EventManager {
* @param entity target entity
* @return the associated McMMOPlayer for this entity
*/
public McMMOPlayer getMcMMOPlayer(Entity entity) {
public BukkitMMOPlayer getMcMMOPlayer(Entity entity) {
return pluginRef.getUserManager().getPlayer((Player) entity);
}
@ -141,7 +141,7 @@ public class EventManager {
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (mcMMOPlayer == null) {
return true;
@ -270,7 +270,7 @@ public class EventManager {
}
public void handlePartyTeleportEvent(Player teleportingPlayer, Player targetPlayer) {
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(teleportingPlayer);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(teleportingPlayer);
if (mcMMOPlayer == null)
return;
@ -381,7 +381,7 @@ public class EventManager {
HashMap<String, Integer> levelChangedVictim = eventVictim.getLevelChanged();
HashMap<String, Double> experienceChangedVictim = eventVictim.getExperienceChanged();
McMMOPlayer killerPlayer = pluginRef.getUserManager().getPlayer(killer);
BukkitMMOPlayer killerPlayer = pluginRef.getUserManager().getPlayer(killer);
//Not loaded
if (killerPlayer == null)

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.util.commands;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
@ -66,7 +66,7 @@ public final class CommandTools {
* @param mcMMOPlayer mcMMOPlayer object of the target player
* @return true if the player is online and a valid mcMMOPlayer object was found
*/
public boolean checkPlayerExistence(CommandSender sender, String playerName, McMMOPlayer mcMMOPlayer) {
public boolean checkPlayerExistence(CommandSender sender, String playerName, BukkitMMOPlayer mcMMOPlayer) {
if (mcMMOPlayer != null) {
if (hidden(sender, mcMMOPlayer.getPlayer(), false)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Offline"));

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.util.experience;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.skills.ExperienceBarHideTask;
@ -15,10 +15,10 @@ import java.util.HashMap;
public class ExperienceBarManager {
HashMap<PrimarySkillType, ExperienceBarWrapper> experienceBars;
HashMap<PrimarySkillType, ExperienceBarHideTask> experienceBarHideTaskHashMap;
private McMMOPlayer mcMMOPlayer;
private BukkitMMOPlayer mcMMOPlayer;
private final mcMMO pluginRef;
public ExperienceBarManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) {
public ExperienceBarManager(mcMMO pluginRef, BukkitMMOPlayer mcMMOPlayer) {
this.pluginRef = pluginRef;
//Init map

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.util.experience;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
@ -16,7 +16,7 @@ import java.util.List;
*/
public class ExperienceBarWrapper {
protected final McMMOPlayer mcMMOPlayer;
protected final BukkitMMOPlayer mcMMOPlayer;
private final PrimarySkillType primarySkillType; //Primary Skill
private BossBar bossBar;
private int lastLevelUpdated;
@ -28,7 +28,7 @@ public class ExperienceBarWrapper {
protected String niceSkillName;
protected String title;
public ExperienceBarWrapper(mcMMO pluginRef, PrimarySkillType primarySkillType, McMMOPlayer mcMMOPlayer) {
public ExperienceBarWrapper(mcMMO pluginRef, PrimarySkillType primarySkillType, BukkitMMOPlayer mcMMOPlayer) {
this.pluginRef = pluginRef;
this.mcMMOPlayer = mcMMOPlayer;
this.primarySkillType = primarySkillType;

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.util.player;
import com.gmail.nossr50.config.notifications.PlayerNotificationSettings;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.notifications.SensitiveCommandType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.events.skills.McMMOPlayerNotificationEvent;
@ -141,7 +141,7 @@ public class NotificationManager {
* @param skillName skill that leveled up
* @param newLevel new level of that skill
*/
public void sendPlayerLevelUpNotification(McMMOPlayer mcMMOPlayer, PrimarySkillType skillName, int levelsGained, int newLevel) {
public void sendPlayerLevelUpNotification(BukkitMMOPlayer mcMMOPlayer, PrimarySkillType skillName, int levelsGained, int newLevel) {
if (!mcMMOPlayer.useChatNotifications())
return;
@ -184,7 +184,7 @@ public class NotificationManager {
}
}
public void sendPlayerUnlockNotification(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType) {
public void sendPlayerUnlockNotification(BukkitMMOPlayer mcMMOPlayer, SubSkillType subSkillType) {
if (!mcMMOPlayer.useChatNotifications())
return;

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.util.player;
import com.gmail.nossr50.datatypes.experience.CustomXPPerk;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.entity.Player;
@ -41,7 +41,7 @@ public class PlayerLevelTools {
* @param primarySkillType target skill
* @return if the player would qualify for the XP boost if its enabled
*/
public boolean qualifiesForEarlyGameBoost(McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType) {
public boolean qualifiesForEarlyGameBoost(BukkitMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType) {
return mcMMOPlayer.getSkillLevel(primarySkillType) < 1;
}

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.util.player;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.OfflinePlayer;
@ -21,7 +21,7 @@ public final class UserManager {
this.pluginRef = pluginRef;
}
private HashSet<McMMOPlayer> playerDataSet; //Used to track players for sync saves on shutdown
private HashSet<BukkitMMOPlayer> playerDataSet; //Used to track players for sync saves on shutdown
/**
@ -29,7 +29,7 @@ public final class UserManager {
*
* @param mcMMOPlayer the player profile to start tracking
*/
public void track(McMMOPlayer mcMMOPlayer) {
public void track(BukkitMMOPlayer mcMMOPlayer) {
mcMMOPlayer.getPlayer().setMetadata(MetadataConstants.PLAYER_DATA_METAKEY, new FixedMetadataValue(pluginRef, mcMMOPlayer));
if(playerDataSet == null)
@ -38,7 +38,7 @@ public final class UserManager {
playerDataSet.add(mcMMOPlayer); //for sync saves on shutdown
}
public void cleanupPlayer(McMMOPlayer mcMMOPlayer) {
public void cleanupPlayer(BukkitMMOPlayer mcMMOPlayer) {
if(playerDataSet != null && playerDataSet.contains(mcMMOPlayer))
playerDataSet.remove(mcMMOPlayer);
}
@ -49,7 +49,7 @@ public final class UserManager {
* @param player The Player object
*/
public void remove(Player player) {
McMMOPlayer mcMMOPlayer = getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = getPlayer(player);
player.removeMetadata(MetadataConstants.PLAYER_DATA_METAKEY, pluginRef);
mcMMOPlayer.cleanup();
@ -77,11 +77,11 @@ public final class UserManager {
if(playerDataSet == null)
return;
ImmutableList<McMMOPlayer> trackedSyncData = ImmutableList.copyOf(playerDataSet);
ImmutableList<BukkitMMOPlayer> trackedSyncData = ImmutableList.copyOf(playerDataSet);
pluginRef.getLogger().info("Saving mcMMOPlayers... (" + trackedSyncData.size() + ")");
for (McMMOPlayer playerData : trackedSyncData) {
for (BukkitMMOPlayer playerData : trackedSyncData) {
try
{
pluginRef.getLogger().info("Saving data for player: "+playerData.getPlayerName());
@ -96,8 +96,8 @@ public final class UserManager {
pluginRef.getLogger().info("Finished save operation for "+trackedSyncData.size()+" players!");
}
public Collection<McMMOPlayer> getPlayers() {
Collection<McMMOPlayer> playerCollection = new ArrayList<>();
public Collection<BukkitMMOPlayer> getPlayers() {
Collection<BukkitMMOPlayer> playerCollection = new ArrayList<>();
for (Player player : pluginRef.getServer().getOnlinePlayers()) {
if (hasPlayerDataKey(player)) {
@ -114,11 +114,11 @@ public final class UserManager {
* @param playerName The name of the player whose McMMOPlayer to retrieve
* @return the player's McMMOPlayer object
*/
public McMMOPlayer getPlayer(String playerName) {
public BukkitMMOPlayer getPlayer(String playerName) {
return retrieveMcMMOPlayer(playerName, false);
}
public McMMOPlayer getOfflinePlayer(OfflinePlayer player) {
public BukkitMMOPlayer getOfflinePlayer(OfflinePlayer player) {
if (player instanceof Player) {
return getPlayer((Player) player);
}
@ -126,7 +126,7 @@ public final class UserManager {
return retrieveMcMMOPlayer(player.getName(), true);
}
public McMMOPlayer getOfflinePlayer(String playerName) {
public BukkitMMOPlayer getOfflinePlayer(String playerName) {
return retrieveMcMMOPlayer(playerName, true);
}
@ -136,15 +136,15 @@ public final class UserManager {
* @param player target player
* @return McMMOPlayer object for this player, null if Player has not been loaded
*/
public McMMOPlayer getPlayer(Player player) {
public BukkitMMOPlayer getPlayer(Player player) {
//Avoid Array Index out of bounds
if (player != null && player.hasMetadata(MetadataConstants.PLAYER_DATA_METAKEY))
return (McMMOPlayer) player.getMetadata(MetadataConstants.PLAYER_DATA_METAKEY).get(0).value();
return (BukkitMMOPlayer) player.getMetadata(MetadataConstants.PLAYER_DATA_METAKEY).get(0).value();
else
return null;
}
private McMMOPlayer retrieveMcMMOPlayer(String playerName, boolean offlineValid) {
private BukkitMMOPlayer retrieveMcMMOPlayer(String playerName, boolean offlineValid) {
Player player = pluginRef.getServer().getPlayerExact(playerName);
if (player == null) {

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.util.random;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
@ -22,7 +22,7 @@ public class RandomChanceSkill implements RandomChanceExecution {
this.subSkillType = subSkillType;
this.probabilityCap = pluginRef.getRandomChanceTools().LINEAR_CURVE_VAR;
final McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
final BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (player != null && mcMMOPlayer != null) {
this.skillLevel = mcMMOPlayer.getSkillLevel(primarySkillType);
} else {
@ -46,7 +46,7 @@ public class RandomChanceSkill implements RandomChanceExecution {
this.primarySkillType = subSkillType.getParentSkill(pluginRef);
this.subSkillType = subSkillType;
final McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
final BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (player != null && mcMMOPlayer != null) {
this.skillLevel = mcMMOPlayer.getSkillLevel(primarySkillType);
} else {

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.util.scoreboards;
import com.gmail.nossr50.datatypes.database.PlayerStat;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.events.scoreboard.McMMOScoreboardMakeboardEvent;
@ -239,7 +239,7 @@ public class ScoreboardManager {
}
for (String playerName : dirtyPowerLevels) {
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(playerName);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(playerName);
if (mcMMOPlayer == null) {
continue;

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.util.scoreboards;
import com.gmail.nossr50.datatypes.database.PlayerStat;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@ -64,7 +64,7 @@ public class ScoreboardWrapper {
powerObjective.setDisplayName(scoreboardStrings.TAG_POWER_LEVEL);
powerObjective.setDisplaySlot(DisplaySlot.BELOW_NAME);
for (McMMOPlayer mcMMOPlayer : pluginRef.getUserManager().getPlayers()) {
for (BukkitMMOPlayer mcMMOPlayer : pluginRef.getUserManager().getPlayers()) {
powerObjective.getScore(mcMMOPlayer.getProfile().getPlayerName()).setScore(mcMMOPlayer.getPowerLevel());
}
}
@ -393,7 +393,7 @@ public class ScoreboardWrapper {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (mcMMOPlayer == null)
return;

View File

@ -5,7 +5,7 @@ import com.gmail.nossr50.datatypes.experience.SpecialXPKey;
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.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
@ -47,7 +47,7 @@ public final class CombatTools {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
SwordsManager swordsManager = mcMMOPlayer.getSwordsManager();
double initialDamage = event.getDamage();
double finalDamage = initialDamage;
@ -91,7 +91,7 @@ public final class CombatTools {
double finalDamage = initialDamage;
Map<DamageModifier, Double> modifiers = getModifiers(event);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
AxesManager axesManager = mcMMOPlayer.getAxesManager();
if (axesManager.canActivateAbility()) {
@ -133,7 +133,7 @@ public final class CombatTools {
double initialDamage = event.getDamage();
double finalDamage = initialDamage;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
UnarmedManager unarmedManager = mcMMOPlayer.getUnarmedManager();
if (unarmedManager.canActivateAbility()) {
@ -170,7 +170,7 @@ public final class CombatTools {
double finalDamage = initialDamage;
if(master != null && !master.isOnline() && master.isValid()) {
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(master);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(master);
//Make sure the profiles been loaded
if(mcMMOPlayer == null) {
@ -207,7 +207,7 @@ public final class CombatTools {
private void processArcheryCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event, Arrow arrow) {
double initialDamage = event.getDamage();
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
ArcheryManager archeryManager = mcMMOPlayer.getArcheryManager();
double finalDamage = event.getDamage();
@ -270,7 +270,7 @@ public final class CombatTools {
if (!pluginRef.getUserManager().hasPlayerDataKey(player)) {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
AcrobaticsManager acrobaticsManager = mcMMOPlayer.getAcrobaticsManager();
if (acrobaticsManager.canDodge(target)) {
@ -363,7 +363,7 @@ public final class CombatTools {
}
if (target.getType() != EntityType.CREEPER && !pluginRef.getMiscTools().isNPCEntityExcludingVillagers(player) && pluginRef.getSkillTools().doesPlayerHaveSkillPermission(PrimarySkillType.TAMING, player)) {
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
BukkitMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
tamingManager.attackTarget(target);
}
@ -684,7 +684,7 @@ public final class CombatTools {
}
}
public void startGainXp(McMMOPlayer mcMMOPlayer, LivingEntity target, PrimarySkillType primarySkillType) {
public void startGainXp(BukkitMMOPlayer mcMMOPlayer, LivingEntity target, PrimarySkillType primarySkillType) {
startGainXp(mcMMOPlayer, target, primarySkillType, 1.0);
}
@ -695,7 +695,7 @@ public final class CombatTools {
* @param target The defending entity
* @param primarySkillType The skill being used
*/
private void startGainXp(McMMOPlayer mcMMOPlayer, LivingEntity target, PrimarySkillType primarySkillType, double multiplier) {
private void startGainXp(BukkitMMOPlayer mcMMOPlayer, LivingEntity target, PrimarySkillType primarySkillType, double multiplier) {
double baseXPMultiplier = 0;
XPGainReason xpGainReason;

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.util.skills;
import com.gmail.nossr50.api.exceptions.MissingSkillPropertyDefinition;
import com.gmail.nossr50.config.skills.ranks.SkillRankProperty;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@ -33,7 +33,7 @@ public class RankTools {
* @param primarySkillType target primary skill
* @param newLevel the new level of this skill
*/
public void executeSkillUnlockNotifications(McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) {
public void executeSkillUnlockNotifications(BukkitMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) {
for (SubSkillType subSkillType : pluginRef.getSkillTools().getSkillAbilities(primarySkillType)) {
int playerRankInSkill = getRank(mcMMOPlayer.getPlayer(), subSkillType);

View File

@ -4,7 +4,7 @@ import com.gmail.nossr50.api.exceptions.InvalidSkillException;
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.gmail.nossr50.datatypes.player.BukkitMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
@ -235,11 +235,11 @@ public class SkillTools {
}
}
public void applyXpGain(McMMOPlayer mcMMOPlayer, PrimarySkillType skill, float xp, XPGainReason xpGainReason) {
public void applyXpGain(BukkitMMOPlayer mcMMOPlayer, PrimarySkillType skill, float xp, XPGainReason xpGainReason) {
mcMMOPlayer.beginXpGain(skill, xp, xpGainReason, XPGainSource.SELF);
}
public void applyXpGain(McMMOPlayer mcMMOPlayer, PrimarySkillType skill, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) {
public void applyXpGain(BukkitMMOPlayer mcMMOPlayer, PrimarySkillType skill, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) {
mcMMOPlayer.beginXpGain(skill, xp, xpGainReason, xpGainSource);
}
@ -251,7 +251,7 @@ public class SkillTools {
* @param superAbilityType target Super Ability
* @return how long an ability should last in seconds
*/
public int calculateAbilityLength(McMMOPlayer mcMMOPlayer, PrimarySkillType skill, SuperAbilityType superAbilityType) {
public int calculateAbilityLength(BukkitMMOPlayer mcMMOPlayer, PrimarySkillType skill, SuperAbilityType superAbilityType) {
//These values change depending on whether or not the server is in retro mode
int abilityLengthVar = pluginRef.getConfigManager().getConfigSuperAbilities().getSuperAbilityStartingSeconds();
@ -279,7 +279,7 @@ public class SkillTools {
* @param superAbilityType target Super Ability
* @return how long an ability should last in seconds
*/
public int calculateAbilityLengthPerks(McMMOPlayer mcMMOPlayer, PrimarySkillType skill, SuperAbilityType superAbilityType) {
public int calculateAbilityLengthPerks(BukkitMMOPlayer mcMMOPlayer, PrimarySkillType skill, SuperAbilityType superAbilityType) {
return getEnduranceLength(mcMMOPlayer.getPlayer()) + calculateAbilityLength(mcMMOPlayer, skill, superAbilityType);
}

View File

@ -1,2 +1,4 @@
rootProject.name= 'mcMMO'
include 'mcmmo-core'
include 'mcmmo-core'
include 'mcmmo-api'