diff --git a/Minecraft-Realms-Emulator/Controllers/WorldsController.cs b/Minecraft-Realms-Emulator/Controllers/WorldsController.cs index 4252798..a3174d8 100644 --- a/Minecraft-Realms-Emulator/Controllers/WorldsController.cs +++ b/Minecraft-Realms-Emulator/Controllers/WorldsController.cs @@ -19,16 +19,14 @@ namespace Minecraft_Realms_Emulator.Controllers [HttpGet] public async Task> GetWorlds() { - var worlds = await _context.Worlds.ToListAsync(); - string cookie = Request.Headers.Cookie; string playerUUID = cookie.Split(";")[0].Split(":")[2]; string playerName = cookie.Split(";")[1].Split("=")[1]; - var hasWorld = worlds.Find(p => p.OwnerUUID == playerUUID); + var worlds = await _context.Worlds.Where(w => w.OwnerUUID == playerUUID).ToListAsync(); - if (hasWorld == null) + if (worlds == null) { var world = new World {