mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +01:00
Sending chunks should be thread safe
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
3d5ae6fe94
commit
538ef75552
@ -124,7 +124,7 @@ public class DynamicChunk extends Chunk {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendChunk(@NotNull Player player) {
|
||||
public synchronized void sendChunk(@NotNull Player player) {
|
||||
if (!isLoaded()) return;
|
||||
final PlayerConnection connection = player.getPlayerConnection();
|
||||
final long lastChange = getLastChangeTime();
|
||||
@ -141,7 +141,7 @@ public class DynamicChunk extends Chunk {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendChunk() {
|
||||
public synchronized void sendChunk() {
|
||||
if (!isLoaded()) return;
|
||||
if (getViewers().isEmpty()) return;
|
||||
final long lastChange = getLastChangeTime();
|
||||
|
Loading…
Reference in New Issue
Block a user