diff --git a/src/main/java/kasuga/lib/core/menu/locator/LocatedMenuManager.java b/src/main/java/kasuga/lib/core/menu/locator/LocatedMenuManager.java index 2c0cf43..3921b85 100644 --- a/src/main/java/kasuga/lib/core/menu/locator/LocatedMenuManager.java +++ b/src/main/java/kasuga/lib/core/menu/locator/LocatedMenuManager.java @@ -47,7 +47,7 @@ public void asClient(List uuids){ if(uuids.isEmpty()){ break; } - menu.asClient(uuids.remove(0)); + menu.asClient(newUuids.remove(0)); } } diff --git a/src/main/java/kasuga/lib/core/menu/locator/ServerChunkMenuLocatorManager.java b/src/main/java/kasuga/lib/core/menu/locator/ServerChunkMenuLocatorManager.java index 9ceff47..7a43234 100644 --- a/src/main/java/kasuga/lib/core/menu/locator/ServerChunkMenuLocatorManager.java +++ b/src/main/java/kasuga/lib/core/menu/locator/ServerChunkMenuLocatorManager.java @@ -72,14 +72,17 @@ public static void transfer(IChunkBasedLocator menuLocator, ChunkPos oldChunk, C List oldPlayers = players.get(oldChunk); List newPlayers = players.get(newChunk); - oldPlayers - .stream() - .filter(player -> !newPlayers.contains(player)) - .forEach(player -> menuLocator.sendDownTo(player.connection.getConnection())); - - newPlayers - .stream() - .filter(player -> !oldPlayers.contains(player)) - .forEach(player -> menuLocator.sendUpTo(player.connection.getConnection())); + + if(oldPlayers != null) + oldPlayers + .stream() + .filter(player -> newPlayers == null ? true : !newPlayers.contains(player)) + .forEach(player -> menuLocator.sendDownTo(player.connection.getConnection())); + + if(newPlayers != null) + newPlayers + .stream() + .filter(player -> oldPlayers == null ? true : !oldPlayers.contains(player)) + .forEach(player -> menuLocator.sendUpTo(player.connection.getConnection())); } }