Skip to content

Commit

Permalink
Merge branch 'gui'
Browse files Browse the repository at this point in the history
  • Loading branch information
TimeBather committed Dec 6, 2024
2 parents e4fd214 + 5dce54b commit 7d70cab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void asClient(List<UUID> uuids){
if(uuids.isEmpty()){
break;
}
menu.asClient(uuids.remove(0));
menu.asClient(newUuids.remove(0));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ public static void transfer(IChunkBasedLocator menuLocator, ChunkPos oldChunk, C

List<ServerPlayer> oldPlayers = players.get(oldChunk);
List<ServerPlayer> 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()));
}
}

0 comments on commit 7d70cab

Please sign in to comment.