mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +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) {
|
if (isPlayer) {
|
||||||
final Player player = (Player) entity;
|
final Player player = (Player) entity;
|
||||||
getWorldBorder().init(player);
|
getWorldBorder().init(player);
|
||||||
|
player.getPlayerConnection().sendPacket(createTimePacket());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send all visible entities
|
// Send all visible entities
|
||||||
|
@ -183,23 +183,25 @@ public class NettyPlayerConnection extends PlayerConnection {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Retrieve safe copy
|
||||||
|
final ByteBuf copy;
|
||||||
synchronized (tickBuffer) {
|
synchronized (tickBuffer) {
|
||||||
final ByteBuf copy = tickBuffer.copy();
|
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());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
tickBuffer.clear();
|
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() {
|
public void flush() {
|
||||||
|
Loading…
Reference in New Issue
Block a user