Work on server data and registries.
This commit is contained in:
@@ -21,6 +21,7 @@ package appeng.core.features.registries;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -28,6 +29,8 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import appeng.api.features.IPlayerRegistry;
|
||||
import appeng.core.worlddata.WorldData;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
public class PlayerRegistry implements IPlayerRegistry
|
||||
{
|
||||
@@ -40,7 +43,7 @@ public class PlayerRegistry implements IPlayerRegistry
|
||||
return -1;
|
||||
}
|
||||
|
||||
return WorldData.instance().playerData().getPlayerID( username );
|
||||
return WorldData.instance().playerData().getMePlayerId( username );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,6 +56,19 @@ public class PlayerRegistry implements IPlayerRegistry
|
||||
@Override
|
||||
public PlayerEntity findPlayer( final int playerID )
|
||||
{
|
||||
return WorldData.instance().playerData().getPlayerFromID( playerID );
|
||||
UUID profileId = WorldData.instance().playerData().getProfileId(playerID);
|
||||
if (profileId == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for( final PlayerEntity player : AppEng.proxy.getPlayers() )
|
||||
{
|
||||
if( player.getUniqueID().equals( profileId ) )
|
||||
{
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user