mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-15 15:16:46 +01:00
Merge branch 'master' into acquirable
This commit is contained in:
commit
be0c425dfc
@ -869,6 +869,7 @@ public abstract class Instance implements BlockModifier, Tickable, EventHandler,
|
||||
if (isPlayer) {
|
||||
final Player player = (Player) entity;
|
||||
getWorldBorder().init(player);
|
||||
player.getPlayerConnection().sendPacket(createTimePacket());
|
||||
}
|
||||
|
||||
// Send all visible entities
|
||||
|
@ -183,23 +183,25 @@ public class NettyPlayerConnection extends PlayerConnection {
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieve safe copy
|
||||
final ByteBuf copy;
|
||||
synchronized (tickBuffer) {
|
||||
final ByteBuf copy = tickBuffer.copy();
|
||||
|
||||
ChannelFuture channelFuture = channel.write(new FramedPacket(copy));
|
||||
channelFuture.addListener(future -> copy.release());
|
||||
|
||||
// Netty debug
|
||||
if (MinecraftServer.shouldProcessNettyErrors()) {
|
||||
channelFuture.addListener(future -> {
|
||||
if (!future.isSuccess() && channel.isActive()) {
|
||||
MinecraftServer.getExceptionManager().handleException(future.cause());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
copy = tickBuffer.copy();
|
||||
tickBuffer.clear();
|
||||
}
|
||||
|
||||
// Write copied buffer to netty
|
||||
ChannelFuture channelFuture = channel.write(new FramedPacket(copy));
|
||||
channelFuture.addListener(future -> copy.release());
|
||||
|
||||
// Netty debug
|
||||
if (MinecraftServer.shouldProcessNettyErrors()) {
|
||||
channelFuture.addListener(future -> {
|
||||
if (!future.isSuccess() && channel.isActive()) {
|
||||
MinecraftServer.getExceptionManager().handleException(future.cause());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void flush() {
|
||||
|
Loading…
Reference in New Issue
Block a user