mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Maybe fixing server crash.
This commit is contained in:
parent
be1bb6632a
commit
2a4e966659
1 changed files with 8 additions and 2 deletions
|
@ -23,9 +23,15 @@ import java.util.UUID;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
public final class PlayerData {
|
public final class PlayerData {
|
||||||
|
private static PlayerSave clientData = null;
|
||||||
public static PlayerSave getDataFromPlayer(Player player) {
|
public static PlayerSave getDataFromPlayer(Player player) {
|
||||||
WorldData worldData = WorldData.get((ServerLevel) player.getCommandSenderWorld());
|
if (!(player.getCommandSenderWorld() instanceof ServerLevel)) {
|
||||||
|
if (clientData == null) {
|
||||||
|
clientData = new PlayerSave(player.getUUID());
|
||||||
|
}
|
||||||
|
return clientData;
|
||||||
|
}
|
||||||
|
WorldData worldData = WorldData.get(player.getCommandSenderWorld());
|
||||||
ConcurrentHashMap<UUID, PlayerSave> data = worldData.playerSaveData;
|
ConcurrentHashMap<UUID, PlayerSave> data = worldData.playerSaveData;
|
||||||
UUID id = player.getUUID();
|
UUID id = player.getUUID();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue