mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Merge pull request #262 from AtlasMediaGroup/FS-449
Stabilization Part 4 - The Lost Episode (Remastered) [FS-449]
This commit is contained in:
commit
a8665a15d4
@ -16,6 +16,7 @@ import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class FPlayer
|
||||
{
|
||||
@ -26,7 +27,7 @@ public class FPlayer
|
||||
private final TotalFreedomMod plugin;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final UUID uuid;
|
||||
private final String ip;
|
||||
//
|
||||
private final FreezeData freezeData = new FreezeData(this);
|
||||
@ -70,12 +71,13 @@ public class FPlayer
|
||||
|
||||
public FPlayer(TotalFreedomMod plugin, Player player)
|
||||
{
|
||||
this(plugin, player.getName(), FUtil.getIp(player));
|
||||
this(plugin, player.getUniqueId(), player.getName(), FUtil.getIp(player));
|
||||
}
|
||||
|
||||
private FPlayer(TotalFreedomMod plugin, String name, String ip)
|
||||
private FPlayer(TotalFreedomMod plugin, UUID uuid, String name, String ip)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
this.uuid = uuid;
|
||||
this.name = name;
|
||||
this.ip = ip;
|
||||
}
|
||||
@ -94,14 +96,7 @@ public class FPlayer
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
for (Player onlinePlayer : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (FUtil.getIp(onlinePlayer).equals(ip))
|
||||
{
|
||||
player = onlinePlayer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
player = Bukkit.getPlayer(uuid);
|
||||
}
|
||||
|
||||
return player;
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.entity.Player;
|
||||
public class PlayerList extends FreedomService
|
||||
{
|
||||
|
||||
public final Map<String, FPlayer> playerMap = Maps.newHashMap(); // ip,dataMap
|
||||
public final Map<UUID, FPlayer> playerMap = Maps.newHashMap(); // uuid, dataMap
|
||||
public final Map<UUID, PlayerData> dataMap = Maps.newHashMap(); // uuid, data
|
||||
|
||||
@Override
|
||||
@ -107,14 +107,14 @@ public class PlayerList extends FreedomService
|
||||
// May not return null
|
||||
public FPlayer getPlayer(Player player)
|
||||
{
|
||||
FPlayer tPlayer = playerMap.get(FUtil.getIp(player));
|
||||
FPlayer tPlayer = playerMap.get(player.getUniqueId());
|
||||
if (tPlayer != null)
|
||||
{
|
||||
return tPlayer;
|
||||
}
|
||||
|
||||
tPlayer = new FPlayer(plugin, player);
|
||||
playerMap.put(FUtil.getIp(player), tPlayer);
|
||||
playerMap.put(player.getUniqueId(), tPlayer);
|
||||
|
||||
return tPlayer;
|
||||
}
|
||||
@ -233,7 +233,7 @@ public class PlayerList extends FreedomService
|
||||
return player;
|
||||
}
|
||||
|
||||
public Map<String, FPlayer> getPlayerMap()
|
||||
public Map<UUID, FPlayer> getPlayerMap()
|
||||
{
|
||||
return playerMap;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user