mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-28 14:37:31 +02:00
Allow FramedPackets to be sent safely
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
be4542e936
commit
4b5ec566bd
@ -120,7 +120,7 @@ public class DynamicChunk extends Chunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void sendChunk(@NotNull Player player) {
|
public void sendChunk(@NotNull Player player) {
|
||||||
if (!isLoaded()) return;
|
if (!isLoaded()) return;
|
||||||
final PlayerConnection connection = player.getPlayerConnection();
|
final PlayerConnection connection = player.getPlayerConnection();
|
||||||
final long lastChange = getLastChangeTime();
|
final long lastChange = getLastChangeTime();
|
||||||
@ -137,7 +137,7 @@ public class DynamicChunk extends Chunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void sendChunk() {
|
public void sendChunk() {
|
||||||
if (!isLoaded()) return;
|
if (!isLoaded()) return;
|
||||||
if (getViewers().isEmpty()) return;
|
if (getViewers().isEmpty()) return;
|
||||||
final long lastChange = getLastChangeTime();
|
final long lastChange = getLastChangeTime();
|
||||||
|
@ -246,7 +246,7 @@ public class PlayerSocketConnection extends PlayerConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void write(@NotNull FramedPacket framedPacket) {
|
public void write(@NotNull FramedPacket framedPacket) {
|
||||||
write(framedPacket.body().position(0));
|
write(framedPacket.body().duplicate().position(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void write(@NotNull ServerPacket packet) {
|
public void write(@NotNull ServerPacket packet) {
|
||||||
|
Loading…
Reference in New Issue
Block a user