Skip to content

Commit 781984f

Browse files
committed
Ensure that chunks only get added once to a scene.
1 parent d86d438 commit 781984f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMapTile.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public boolean render(MapChunkCache mapChunkCache, String s) {
9292
scene.loadChunks(SilentTaskTracker.INSTANCE, chunkyWorld,
9393
perspective.getRequiredChunks(this).stream()
9494
.flatMap(c -> getChunksAround(c.x, c.z, map.getChunkPadding()).stream())
95-
.collect(Collectors.toList()));
95+
.collect(Collectors.toSet()));
9696
scene.getActors().removeIf(actor -> actor instanceof PlayerEntity);
9797
try {
9898
scene.saveScene(context, new TaskTracker(ProgressListener.NONE));
@@ -105,9 +105,9 @@ public boolean render(MapChunkCache mapChunkCache, String s) {
105105
chunks.setAccessible(true);
106106
Collection<ChunkPosition> chunksList = (Collection<ChunkPosition>) chunks.get(scene);
107107
chunksList.clear();
108-
perspective.getRequiredChunks(this).stream()
108+
chunksList.addAll(perspective.getRequiredChunks(this).stream()
109109
.flatMap(c -> getChunksAround(c.x, c.z, map.getChunkPadding()).stream())
110-
.forEach(chunksList::add);
110+
.collect(Collectors.toSet()));
111111
} catch (ReflectiveOperationException e) {
112112
throw new RuntimeException("Could not set chunks", e);
113113
}

0 commit comments

Comments
 (0)