mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-27 04:35:46 +01:00
Fix for proxy command not working with offline players
This commit is contained in:
parent
a97d951b7f
commit
00e5ff18ec
@ -8,6 +8,7 @@ import com.songoda.skyblock.island.IslandManager;
|
||||
import com.songoda.skyblock.message.MessageManager;
|
||||
import com.songoda.skyblock.sound.SoundManager;
|
||||
import com.songoda.skyblock.utils.player.OfflinePlayer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
@ -39,9 +40,10 @@ public class ProxyCommand extends SubCommand {
|
||||
|
||||
if (args.length == 1) {
|
||||
OfflinePlayer targetPlayerOffline = new OfflinePlayer(args[0]);
|
||||
|
||||
UUID islandOwnerUUID = targetPlayerOffline.getOwner();
|
||||
|
||||
if (islandManager.containsIsland(islandOwnerUUID)) {
|
||||
if (islandManager.getIsland(Bukkit.getOfflinePlayer(islandOwnerUUID)) != null) {
|
||||
if (islandManager.isPlayerProxyingAnotherPlayer(((Player)sender).getUniqueId())) {
|
||||
messageManager.sendMessage(sender,
|
||||
configLoad.getString("Command.Island.Admin.Proxy.IsOffPlayer.Message")
|
||||
|
@ -1191,8 +1191,8 @@ public class IslandManager {
|
||||
return islandStorage.get(uuid);
|
||||
}
|
||||
|
||||
if (offlinePlayer.isOnline()) {
|
||||
Player player = offlinePlayer.getPlayer();
|
||||
Player player = offlinePlayer.getPlayer();
|
||||
if (offlinePlayer.isOnline() && player != null) {
|
||||
|
||||
if (playerDataManager.hasPlayerData(player)) {
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
@ -1207,6 +1207,8 @@ public class IslandManager {
|
||||
if (offlinePlayerData.getOwner() != null && islandStorage.containsKey(offlinePlayer.getUniqueId())) {
|
||||
return islandStorage.get(offlinePlayerData.getOwner());
|
||||
}
|
||||
|
||||
return loadIsland(offlinePlayer); // TODO That could be done first, needs testing - Fabrimat
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user