diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/helper/NettyHelper.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/helper/NettyHelper.java new file mode 100644 index 00000000..fdbee4c7 --- /dev/null +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/helper/NettyHelper.java @@ -0,0 +1,149 @@ +package org.geysermc.mcprotocollib.network.helper; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.AddressedEnvelope; +import io.netty.channel.Channel; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import io.netty.channel.ChannelPipeline; +import io.netty.channel.EventLoop; +import io.netty.handler.codec.dns.DefaultDnsQuestion; +import io.netty.handler.codec.dns.DefaultDnsRawRecord; +import io.netty.handler.codec.dns.DefaultDnsRecordDecoder; +import io.netty.handler.codec.dns.DnsRecordType; +import io.netty.handler.codec.dns.DnsResponse; +import io.netty.handler.codec.dns.DnsSection; +import io.netty.handler.codec.haproxy.HAProxyCommand; +import io.netty.handler.codec.haproxy.HAProxyMessage; +import io.netty.handler.codec.haproxy.HAProxyMessageEncoder; +import io.netty.handler.codec.haproxy.HAProxyProtocolVersion; +import io.netty.handler.codec.haproxy.HAProxyProxiedProtocol; +import io.netty.handler.proxy.HttpProxyHandler; +import io.netty.handler.proxy.Socks4ProxyHandler; +import io.netty.handler.proxy.Socks5ProxyHandler; +import io.netty.resolver.dns.DnsNameResolver; +import io.netty.resolver.dns.DnsNameResolverBuilder; +import org.geysermc.mcprotocollib.network.BuiltinFlags; +import org.geysermc.mcprotocollib.network.ProxyInfo; +import org.geysermc.mcprotocollib.network.Session; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.UnknownHostException; + +public class NettyHelper { + private static final Logger log = LoggerFactory.getLogger(NettyHelper.class); + private static final String IP_REGEX = "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b"; + + public static InetSocketAddress resolveAddress(Session session, EventLoop eventLoop, String host, int port) { + String name = session.getPacketProtocol().getSRVRecordPrefix() + "._tcp." + host; + log.debug("Attempting SRV lookup for \"{}\".", name); + + if (session.getFlag(BuiltinFlags.ATTEMPT_SRV_RESOLVE, true) && (!host.matches(IP_REGEX) && !host.equalsIgnoreCase("localhost"))) { + try (DnsNameResolver resolver = new DnsNameResolverBuilder(eventLoop) + .channelFactory(TransportHelper.TRANSPORT_TYPE.datagramChannelFactory()) + .build()) { + AddressedEnvelope envelope = resolver.query(new DefaultDnsQuestion(name, DnsRecordType.SRV)).get(); + try { + DnsResponse response = envelope.content(); + if (response.count(DnsSection.ANSWER) > 0) { + DefaultDnsRawRecord record = response.recordAt(DnsSection.ANSWER, 0); + if (record.type() == DnsRecordType.SRV) { + ByteBuf buf = record.content(); + buf.skipBytes(4); // Skip priority and weight. + + int tempPort = buf.readUnsignedShort(); + String tempHost = DefaultDnsRecordDecoder.decodeName(buf); + if (tempHost.endsWith(".")) { + tempHost = tempHost.substring(0, tempHost.length() - 1); + } + + log.debug("Found SRV record containing \"{}:{}\".", tempHost, tempPort); + + host = tempHost; + port = tempPort; + } else { + log.debug("Received non-SRV record in response."); + } + } else { + log.debug("No SRV record found."); + } + } finally { + envelope.release(); + } + } catch (Exception e) { + log.debug("Failed to resolve SRV record.", e); + } + } else { + log.debug("Not resolving SRV record for {}", host); + } + + // Resolve host here + try { + InetAddress resolved = InetAddress.getByName(host); + log.debug("Resolved {} -> {}", host, resolved.getHostAddress()); + return new InetSocketAddress(resolved, port); + } catch (UnknownHostException e) { + log.debug("Failed to resolve host, letting Netty do it instead.", e); + return InetSocketAddress.createUnresolved(host, port); + } + } + + public static void initializeHAProxySupport(Session session, Channel channel) { + InetSocketAddress clientAddress = session.getFlag(BuiltinFlags.CLIENT_PROXIED_ADDRESS); + if (clientAddress == null) { + return; + } + + channel.pipeline().addLast("proxy-protocol-encoder", HAProxyMessageEncoder.INSTANCE); + channel.pipeline().addLast("proxy-protocol-packet-sender", new ChannelInboundHandlerAdapter() { + @Override + public void channelActive(ChannelHandlerContext ctx) throws Exception { + InetSocketAddress remoteAddress = (InetSocketAddress) ctx.channel().remoteAddress(); + HAProxyProxiedProtocol proxiedProtocol = clientAddress.getAddress() instanceof Inet4Address ? HAProxyProxiedProtocol.TCP4 : HAProxyProxiedProtocol.TCP6; + ctx.channel().writeAndFlush(new HAProxyMessage( + HAProxyProtocolVersion.V2, HAProxyCommand.PROXY, proxiedProtocol, + clientAddress.getAddress().getHostAddress(), remoteAddress.getAddress().getHostAddress(), + clientAddress.getPort(), remoteAddress.getPort() + )).addListener(future -> channel.pipeline().remove("proxy-protocol-encoder")); + ctx.pipeline().remove(this); + + super.channelActive(ctx); + } + }); + } + + public static void addProxy(ProxyInfo proxy, ChannelPipeline pipeline) { + if (proxy == null) { + return; + } + + switch (proxy.type()) { + case HTTP -> { + if (proxy.username() != null && proxy.password() != null) { + pipeline.addLast("proxy", new HttpProxyHandler(proxy.address(), proxy.username(), proxy.password())); + } else { + pipeline.addLast("proxy", new HttpProxyHandler(proxy.address())); + } + } + case SOCKS4 -> { + if (proxy.username() != null) { + pipeline.addLast("proxy", new Socks4ProxyHandler(proxy.address(), proxy.username())); + } else { + pipeline.addLast("proxy", new Socks4ProxyHandler(proxy.address())); + } + } + case SOCKS5 -> { + if (proxy.username() != null && proxy.password() != null) { + pipeline.addLast("proxy", new Socks5ProxyHandler(proxy.address(), proxy.username(), proxy.password())); + } else { + pipeline.addLast("proxy", new Socks5ProxyHandler(proxy.address())); + } + } + default -> throw new UnsupportedOperationException("Unsupported proxy type: " + proxy.type()); + } + } +} diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/helper/TransportHelper.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/helper/TransportHelper.java index 7e526837..7c7e4a07 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/helper/TransportHelper.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/helper/TransportHelper.java @@ -29,6 +29,8 @@ import java.util.concurrent.ThreadFactory; import java.util.function.Function; public class TransportHelper { + public static final TransportHelper.TransportType TRANSPORT_TYPE = TransportHelper.determineTransportMethod(); + public enum TransportMethod { NIO, EPOLL, KQUEUE, IO_URING } @@ -45,7 +47,7 @@ public class TransportHelper { boolean supportsTcpFastOpenClient) { } - public static TransportType determineTransportMethod() { + private static TransportType determineTransportMethod() { if (isClassAvailable("io.netty.incubator.channel.uring.IOUring") && IOUring.isAvailable()) { return new TransportType( TransportMethod.IO_URING, diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/packet/Packet.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/packet/Packet.java index 94d68197..0317b5c2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/packet/Packet.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/packet/Packet.java @@ -9,13 +9,14 @@ import org.geysermc.mcprotocollib.network.Session; public interface Packet { /** - * Gets whether the packet has handling priority. - * If the result is true, the packet will be handled immediately after being - * decoded. + * Gets whether the packet should run on an async game thread rather than blocking the network (Netty) thread. + * Packets that qualify for this are usually packets with an ensureRunningOnSameThread call at the top of their packet listener method in the Minecraft code. + * Packets which need extra attention because they aren't "fully" handled async are marked using + * // GAME THREAD DETAIL comments in the MCProtocolLib code. * - * @return Whether the packet has priority. + * @return Whether the packet be handled async from the Netty thread. */ - default boolean isPriority() { + default boolean shouldRunOnGameThread() { return false; } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/DefaultPacketHandlerExecutor.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/DefaultPacketHandlerExecutor.java new file mode 100644 index 00000000..e9cb75b4 --- /dev/null +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/DefaultPacketHandlerExecutor.java @@ -0,0 +1,34 @@ +package org.geysermc.mcprotocollib.network.tcp; + +import io.netty.channel.DefaultEventLoopGroup; +import io.netty.channel.EventLoopGroup; +import io.netty.util.concurrent.DefaultThreadFactory; + +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; + +public class DefaultPacketHandlerExecutor { + /** + * Controls whether non-priority packets are handled in a separate event loop + */ + public static boolean USE_EVENT_LOOP_FOR_PACKETS = true; + private static EventLoopGroup PACKET_EVENT_LOOP; + private static final int SHUTDOWN_QUIET_PERIOD_MS = 100; + private static final int SHUTDOWN_TIMEOUT_MS = 500; + + public static Executor createExecutor() { + if (!USE_EVENT_LOOP_FOR_PACKETS) { + return Runnable::run; + } + + if (PACKET_EVENT_LOOP == null) { + // See TcpClientSession.newThreadFactory() for details on + // daemon threads and their interaction with the runtime. + PACKET_EVENT_LOOP = new DefaultEventLoopGroup(new DefaultThreadFactory(DefaultPacketHandlerExecutor.class, true)); + Runtime.getRuntime().addShutdownHook(new Thread( + () -> PACKET_EVENT_LOOP.shutdownGracefully(SHUTDOWN_QUIET_PERIOD_MS, SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS))); + } + + return PACKET_EVENT_LOOP.next(); + } +} diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpClientSession.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpClientSession.java index 4c3ac62f..eaed1ec8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpClientSession.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpClientSession.java @@ -1,55 +1,28 @@ package org.geysermc.mcprotocollib.network.tcp; import io.netty.bootstrap.Bootstrap; -import io.netty.buffer.ByteBuf; -import io.netty.channel.AddressedEnvelope; import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPipeline; import io.netty.channel.EventLoopGroup; -import io.netty.handler.codec.dns.DefaultDnsQuestion; -import io.netty.handler.codec.dns.DefaultDnsRawRecord; -import io.netty.handler.codec.dns.DefaultDnsRecordDecoder; -import io.netty.handler.codec.dns.DnsRecordType; -import io.netty.handler.codec.dns.DnsResponse; -import io.netty.handler.codec.dns.DnsSection; -import io.netty.handler.codec.haproxy.HAProxyCommand; -import io.netty.handler.codec.haproxy.HAProxyMessage; -import io.netty.handler.codec.haproxy.HAProxyMessageEncoder; -import io.netty.handler.codec.haproxy.HAProxyProtocolVersion; -import io.netty.handler.codec.haproxy.HAProxyProxiedProtocol; -import io.netty.handler.proxy.HttpProxyHandler; -import io.netty.handler.proxy.Socks4ProxyHandler; -import io.netty.handler.proxy.Socks5ProxyHandler; import io.netty.handler.timeout.ReadTimeoutHandler; import io.netty.handler.timeout.WriteTimeoutHandler; -import io.netty.resolver.dns.DnsNameResolver; -import io.netty.resolver.dns.DnsNameResolverBuilder; import io.netty.util.concurrent.DefaultThreadFactory; import org.checkerframework.checker.nullness.qual.NonNull; import org.geysermc.mcprotocollib.network.BuiltinFlags; import org.geysermc.mcprotocollib.network.ProxyInfo; import org.geysermc.mcprotocollib.network.codec.PacketCodecHelper; +import org.geysermc.mcprotocollib.network.helper.NettyHelper; import org.geysermc.mcprotocollib.network.helper.TransportHelper; import org.geysermc.mcprotocollib.network.packet.PacketProtocol; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.net.Inet4Address; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.UnknownHostException; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; public class TcpClientSession extends TcpSession { - private static final TransportHelper.TransportType TRANSPORT_TYPE = TransportHelper.determineTransportMethod(); - private static final String IP_REGEX = "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b"; - private static final Logger log = LoggerFactory.getLogger(TcpClientSession.class); private static EventLoopGroup EVENT_LOOP_GROUP; /** @@ -76,7 +49,11 @@ public class TcpClientSession extends TcpSession { } public TcpClientSession(String host, int port, String bindAddress, int bindPort, PacketProtocol protocol, ProxyInfo proxy) { - super(host, port, protocol); + this(host, port, bindAddress, bindPort, protocol, proxy, DefaultPacketHandlerExecutor.createExecutor()); + } + + public TcpClientSession(String host, int port, String bindAddress, int bindPort, PacketProtocol protocol, ProxyInfo proxy, Executor packetHandlerExecutor) { + super(host, port, protocol, packetHandlerExecutor); this.bindAddress = bindAddress; this.bindPort = bindPort; this.proxy = proxy; @@ -94,12 +71,12 @@ public class TcpClientSession extends TcpSession { } final Bootstrap bootstrap = new Bootstrap() - .channelFactory(TRANSPORT_TYPE.socketChannelFactory()) + .channelFactory(TransportHelper.TRANSPORT_TYPE.socketChannelFactory()) .option(ChannelOption.TCP_NODELAY, true) .option(ChannelOption.IP_TOS, 0x18) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, getFlag(BuiltinFlags.CLIENT_CONNECT_TIMEOUT, 30) * 1000) .group(EVENT_LOOP_GROUP) - .remoteAddress(resolveAddress()) + .remoteAddress(NettyHelper.resolveAddress(this, EVENT_LOOP_GROUP.next(), getHost(), getPort())) .localAddress(bindAddress, bindPort) .handler(new ChannelInitializer<>() { @Override @@ -109,9 +86,9 @@ public class TcpClientSession extends TcpSession { ChannelPipeline pipeline = channel.pipeline(); - addProxy(pipeline); + NettyHelper.addProxy(proxy, pipeline); - initializeHAProxySupport(channel); + NettyHelper.initializeHAProxySupport(TcpClientSession.this, channel); pipeline.addLast("read-timeout", new ReadTimeoutHandler(getFlag(BuiltinFlags.READ_TIMEOUT, 30))); pipeline.addLast("write-timeout", new WriteTimeoutHandler(getFlag(BuiltinFlags.WRITE_TIMEOUT, 0))); @@ -127,7 +104,7 @@ public class TcpClientSession extends TcpSession { } }); - if (getFlag(BuiltinFlags.TCP_FAST_OPEN, false) && TRANSPORT_TYPE.supportsTcpFastOpenClient()) { + if (getFlag(BuiltinFlags.TCP_FAST_OPEN, false) && TransportHelper.TRANSPORT_TYPE.supportsTcpFastOpenClient()) { bootstrap.option(ChannelOption.TCP_FASTOPEN_CONNECT, true); } @@ -150,121 +127,12 @@ public class TcpClientSession extends TcpSession { return this.codecHelper; } - private InetSocketAddress resolveAddress() { - String name = this.getPacketProtocol().getSRVRecordPrefix() + "._tcp." + this.getHost(); - log.debug("Attempting SRV lookup for \"{}\".", name); - - if (getFlag(BuiltinFlags.ATTEMPT_SRV_RESOLVE, true) && (!this.host.matches(IP_REGEX) && !this.host.equalsIgnoreCase("localhost"))) { - try (DnsNameResolver resolver = new DnsNameResolverBuilder(EVENT_LOOP_GROUP.next()) - .channelFactory(TRANSPORT_TYPE.datagramChannelFactory()) - .build()) { - AddressedEnvelope envelope = resolver.query(new DefaultDnsQuestion(name, DnsRecordType.SRV)).get(); - try { - DnsResponse response = envelope.content(); - if (response.count(DnsSection.ANSWER) > 0) { - DefaultDnsRawRecord record = response.recordAt(DnsSection.ANSWER, 0); - if (record.type() == DnsRecordType.SRV) { - ByteBuf buf = record.content(); - buf.skipBytes(4); // Skip priority and weight. - - int port = buf.readUnsignedShort(); - String host = DefaultDnsRecordDecoder.decodeName(buf); - if (host.endsWith(".")) { - host = host.substring(0, host.length() - 1); - } - - log.debug("Found SRV record containing \"{}:{}\".", host, port); - - this.host = host; - this.port = port; - } else { - log.debug("Received non-SRV record in response."); - } - } else { - log.debug("No SRV record found."); - } - } finally { - envelope.release(); - } - } catch (Exception e) { - log.debug("Failed to resolve SRV record.", e); - } - } else { - log.debug("Not resolving SRV record for {}", this.host); - } - - // Resolve host here - try { - InetAddress resolved = InetAddress.getByName(getHost()); - log.debug("Resolved {} -> {}", getHost(), resolved.getHostAddress()); - return new InetSocketAddress(resolved, getPort()); - } catch (UnknownHostException e) { - log.debug("Failed to resolve host, letting Netty do it instead.", e); - return InetSocketAddress.createUnresolved(getHost(), getPort()); - } - } - - private void addProxy(ChannelPipeline pipeline) { - if (proxy == null) { - return; - } - - switch (proxy.type()) { - case HTTP -> { - if (proxy.username() != null && proxy.password() != null) { - pipeline.addLast("proxy", new HttpProxyHandler(proxy.address(), proxy.username(), proxy.password())); - } else { - pipeline.addLast("proxy", new HttpProxyHandler(proxy.address())); - } - } - case SOCKS4 -> { - if (proxy.username() != null) { - pipeline.addLast("proxy", new Socks4ProxyHandler(proxy.address(), proxy.username())); - } else { - pipeline.addLast("proxy", new Socks4ProxyHandler(proxy.address())); - } - } - case SOCKS5 -> { - if (proxy.username() != null && proxy.password() != null) { - pipeline.addLast("proxy", new Socks5ProxyHandler(proxy.address(), proxy.username(), proxy.password())); - } else { - pipeline.addLast("proxy", new Socks5ProxyHandler(proxy.address())); - } - } - default -> throw new UnsupportedOperationException("Unsupported proxy type: " + proxy.type()); - } - } - - private void initializeHAProxySupport(Channel channel) { - InetSocketAddress clientAddress = getFlag(BuiltinFlags.CLIENT_PROXIED_ADDRESS); - if (clientAddress == null) { - return; - } - - channel.pipeline().addLast("proxy-protocol-encoder", HAProxyMessageEncoder.INSTANCE); - channel.pipeline().addLast("proxy-protocol-packet-sender", new ChannelInboundHandlerAdapter() { - @Override - public void channelActive(ChannelHandlerContext ctx) throws Exception { - InetSocketAddress remoteAddress = (InetSocketAddress) ctx.channel().remoteAddress(); - HAProxyProxiedProtocol proxiedProtocol = clientAddress.getAddress() instanceof Inet4Address ? HAProxyProxiedProtocol.TCP4 : HAProxyProxiedProtocol.TCP6; - ctx.channel().writeAndFlush(new HAProxyMessage( - HAProxyProtocolVersion.V2, HAProxyCommand.PROXY, proxiedProtocol, - clientAddress.getAddress().getHostAddress(), remoteAddress.getAddress().getHostAddress(), - clientAddress.getPort(), remoteAddress.getPort() - )).addListener(future -> channel.pipeline().remove("proxy-protocol-encoder")); - ctx.pipeline().remove(this); - - super.channelActive(ctx); - } - }); - } - private static void createTcpEventLoopGroup() { if (EVENT_LOOP_GROUP != null) { return; } - EVENT_LOOP_GROUP = TRANSPORT_TYPE.eventLoopGroupFactory().apply(newThreadFactory()); + EVENT_LOOP_GROUP = TransportHelper.TRANSPORT_TYPE.eventLoopGroupFactory().apply(newThreadFactory()); Runtime.getRuntime().addShutdownHook(new Thread( () -> EVENT_LOOP_GROUP.shutdownGracefully(SHUTDOWN_QUIET_PERIOD_MS, SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS))); diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java index 809a88c7..48be8c01 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java @@ -19,17 +19,23 @@ import org.slf4j.LoggerFactory; import java.net.InetSocketAddress; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; import java.util.function.Supplier; public class TcpServer extends AbstractServer { - private static final TransportHelper.TransportType TRANSPORT_TYPE = TransportHelper.determineTransportMethod(); private static final Logger log = LoggerFactory.getLogger(TcpServer.class); + private final Supplier packetHandlerExecutorFactory; private EventLoopGroup group; private Channel channel; public TcpServer(String host, int port, Supplier protocol) { + this(host, port, protocol, DefaultPacketHandlerExecutor::createExecutor); + } + + public TcpServer(String host, int port, Supplier protocol, Supplier packetHandlerExecutorFactory) { super(host, port, protocol); + this.packetHandlerExecutorFactory = packetHandlerExecutorFactory; } @Override @@ -43,10 +49,10 @@ public class TcpServer extends AbstractServer { return; } - this.group = TRANSPORT_TYPE.eventLoopGroupFactory().apply(null); + this.group = TransportHelper.TRANSPORT_TYPE.eventLoopGroupFactory().apply(null); ServerBootstrap bootstrap = new ServerBootstrap() - .channelFactory(TRANSPORT_TYPE.serverSocketChannelFactory()) + .channelFactory(TransportHelper.TRANSPORT_TYPE.serverSocketChannelFactory()) .group(this.group) .childOption(ChannelOption.TCP_NODELAY, true) .childOption(ChannelOption.IP_TOS, 0x18) @@ -57,7 +63,7 @@ public class TcpServer extends AbstractServer { InetSocketAddress address = (InetSocketAddress) channel.remoteAddress(); PacketProtocol protocol = createPacketProtocol(); - TcpSession session = new TcpServerSession(address.getHostName(), address.getPort(), protocol, TcpServer.this); + TcpSession session = new TcpServerSession(address.getHostName(), address.getPort(), protocol, TcpServer.this, packetHandlerExecutorFactory.get()); session.getPacketProtocol().newServerSession(TcpServer.this, session); ChannelPipeline pipeline = channel.pipeline(); @@ -76,7 +82,7 @@ public class TcpServer extends AbstractServer { } }); - if (getGlobalFlag(BuiltinFlags.TCP_FAST_OPEN, false) && TRANSPORT_TYPE.supportsTcpFastOpenServer()) { + if (getGlobalFlag(BuiltinFlags.TCP_FAST_OPEN, false) && TransportHelper.TRANSPORT_TYPE.supportsTcpFastOpenServer()) { bootstrap.option(ChannelOption.TCP_FASTOPEN, 3); } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServerSession.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServerSession.java index f8477930..5fe68a3c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServerSession.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServerSession.java @@ -7,13 +7,14 @@ import org.geysermc.mcprotocollib.network.packet.PacketProtocol; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.Executor; public class TcpServerSession extends TcpSession { private final TcpServer server; private final PacketCodecHelper codecHelper; - public TcpServerSession(String host, int port, PacketProtocol protocol, TcpServer server) { - super(host, port, protocol); + public TcpServerSession(String host, int port, PacketProtocol protocol, TcpServer server, Executor packetHandlerExecutor) { + super(host, port, protocol, packetHandlerExecutor); this.server = server; this.codecHelper = protocol.createHelper(); } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpSession.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpSession.java index f17fa910..7af102dd 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpSession.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpSession.java @@ -3,11 +3,7 @@ package org.geysermc.mcprotocollib.network.tcp; import io.netty.channel.Channel; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.DefaultEventLoopGroup; -import io.netty.channel.EventLoop; -import io.netty.channel.EventLoopGroup; import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.util.concurrent.DefaultThreadFactory; import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; @@ -33,24 +29,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.Executor; import java.util.concurrent.TimeoutException; public abstract class TcpSession extends SimpleChannelInboundHandler implements Session { private static final Logger log = LoggerFactory.getLogger(TcpSession.class); - /** - * Controls whether non-priority packets are handled in a separate event loop - */ - public static boolean USE_EVENT_LOOP_FOR_PACKETS = true; - private static EventLoopGroup PACKET_EVENT_LOOP; - private static final int SHUTDOWN_QUIET_PERIOD_MS = 100; - private static final int SHUTDOWN_TIMEOUT_MS = 500; - protected String host; protected int port; private final PacketProtocol protocol; - private final EventLoop eventLoop = createEventLoop(); + private final Executor packetHandlerExecutor; private final Map flags = new HashMap<>(); private final List listeners = new CopyOnWriteArrayList<>(); @@ -58,10 +46,11 @@ public abstract class TcpSession extends SimpleChannelInboundHandler imp private Channel channel; protected boolean disconnected = false; - public TcpSession(String host, int port, PacketProtocol protocol) { + public TcpSession(String host, int port, PacketProtocol protocol, Executor packetHandlerExecutor) { this.host = host; this.port = port; this.protocol = protocol; + this.packetHandlerExecutor = packetHandlerExecutor; } @Override @@ -269,21 +258,6 @@ public abstract class TcpSession extends SimpleChannelInboundHandler imp } } - private @Nullable EventLoop createEventLoop() { - if (!USE_EVENT_LOOP_FOR_PACKETS) { - return null; - } - - if (PACKET_EVENT_LOOP == null) { - // See TcpClientSession.newThreadFactory() for details on - // daemon threads and their interaction with the runtime. - PACKET_EVENT_LOOP = new DefaultEventLoopGroup(new DefaultThreadFactory(this.getClass(), true)); - Runtime.getRuntime().addShutdownHook(new Thread( - () -> PACKET_EVENT_LOOP.shutdownGracefully(SHUTDOWN_QUIET_PERIOD_MS, SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS))); - } - return PACKET_EVENT_LOOP.next(); - } - @Override public Channel getChannel() { return this.channel; @@ -322,8 +296,8 @@ public abstract class TcpSession extends SimpleChannelInboundHandler imp @Override protected void channelRead0(ChannelHandlerContext ctx, Packet packet) { - if (!packet.isPriority() && eventLoop != null) { - eventLoop.execute(() -> this.callPacketReceived(packet)); + if (packet.shouldRunOnGameThread()) { + packetHandlerExecutor.execute(() -> this.callPacketReceived(packet)); } else { this.callPacketReceived(packet); } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java index cd95351f..96c7a71f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java @@ -37,9 +37,9 @@ import org.geysermc.mcprotocollib.protocol.packet.login.clientbound.ClientboundL import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundHelloPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundLoginAcknowledgedPacket; -import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundPongResponsePacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.clientbound.ClientboundPongResponsePacket; import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundStatusResponsePacket; -import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundPingRequestPacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.serverbound.ServerboundPingRequestPacket; import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundStatusRequestPacket; import javax.crypto.KeyGenerator; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java index 137c4096..d6f5c9b2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java @@ -35,9 +35,9 @@ import org.geysermc.mcprotocollib.protocol.packet.login.clientbound.ClientboundL import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundHelloPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundLoginAcknowledgedPacket; -import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundPongResponsePacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.clientbound.ClientboundPongResponsePacket; import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundStatusResponsePacket; -import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundPingRequestPacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.serverbound.ServerboundPingRequestPacket; import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundStatusRequestPacket; import javax.crypto.SecretKey; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java index cfa25a87..5335ec2c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java @@ -1,7 +1,7 @@ package org.geysermc.mcprotocollib.protocol.codec; import org.geysermc.mcprotocollib.protocol.data.ProtocolState; -import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundCookieRequestPacket; +import org.geysermc.mcprotocollib.protocol.packet.cookie.clientbound.ClientboundCookieRequestPacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundCustomPayloadPacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundCustomReportDetailsPacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundDisconnectPacket; @@ -13,7 +13,7 @@ import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.Clientbound import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundStoreCookiePacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundTransferPacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundUpdateTagsPacket; -import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ServerboundCookieResponsePacket; +import org.geysermc.mcprotocollib.protocol.packet.cookie.serverbound.ServerboundCookieResponsePacket; import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundClientInformationPacket; import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundCustomPayloadPacket; import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundKeepAlivePacket; @@ -209,9 +209,9 @@ import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundC import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundHelloPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundLoginAcknowledgedPacket; -import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundPongResponsePacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.clientbound.ClientboundPongResponsePacket; import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundStatusResponsePacket; -import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundPingRequestPacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.serverbound.ServerboundPingRequestPacket; import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundStatusRequestPacket; public class MinecraftCodec { diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomPayloadPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomPayloadPacket.java index fcd917ee..8f7eca9e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomPayloadPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomPayloadPacket.java @@ -26,4 +26,10 @@ public class ClientboundCustomPayloadPacket implements MinecraftPacket { helper.writeResourceLocation(out, this.channel); out.writeBytes(this.data); } + + @Override + public boolean shouldRunOnGameThread() { + // GAME THREAD DETAIL: Only non-discarded payloads are handled async. + return false; // False, you need to handle making it async yourself + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomReportDetailsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomReportDetailsPacket.java index 17d144c3..891e9317 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomReportDetailsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomReportDetailsPacket.java @@ -33,4 +33,9 @@ public class ClientboundCustomReportDetailsPacket implements MinecraftPacket { helper.writeString(out, entry.getValue()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundDisconnectPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundDisconnectPacket.java index cf9b05a1..927dacc2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundDisconnectPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundDisconnectPacket.java @@ -28,9 +28,4 @@ public class ClientboundDisconnectPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeComponent(out, this.reason); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundPingPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundPingPacket.java index b11c4bfd..b09f29a5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundPingPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundPingPacket.java @@ -21,4 +21,9 @@ public class ClientboundPingPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeInt(this.id); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPopPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPopPacket.java index 5d63071b..4f8d4019 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPopPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPopPacket.java @@ -28,4 +28,9 @@ public class ClientboundResourcePackPopPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeNullable(out, this.id, helper::writeUUID); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPushPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPushPacket.java index 4aec3c92..edc123a8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPushPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPushPacket.java @@ -38,4 +38,9 @@ public class ClientboundResourcePackPushPacket implements MinecraftPacket { out.writeBoolean(this.required); helper.writeNullable(out, this.prompt, helper::writeComponent); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundServerLinksPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundServerLinksPacket.java index e6a28a10..6cd53982 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundServerLinksPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundServerLinksPacket.java @@ -52,4 +52,9 @@ public class ClientboundServerLinksPacket implements MinecraftPacket { helper.writeString(out, link.link()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundStoreCookiePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundStoreCookiePacket.java index a7a9753c..22eec45f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundStoreCookiePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundStoreCookiePacket.java @@ -25,4 +25,9 @@ public class ClientboundStoreCookiePacket implements MinecraftPacket { helper.writeResourceLocation(out, this.key); helper.writeByteArray(out, this.payload); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundTransferPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundTransferPacket.java index 2bc8d109..72fbc2d7 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundTransferPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundTransferPacket.java @@ -24,4 +24,10 @@ public class ClientboundTransferPacket implements MinecraftPacket { helper.writeString(out, this.host); helper.writeVarInt(out, this.port); } + + @Override + public boolean shouldRunOnGameThread() { + // GAME THREAD DETAIL: Code runs before packet is made async. + return false; // False, you need to handle making it async yourself + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundUpdateTagsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundUpdateTagsPacket.java index 0bfff1fe..b09104f2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundUpdateTagsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundUpdateTagsPacket.java @@ -53,4 +53,9 @@ public class ClientboundUpdateTagsPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundClientInformationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundClientInformationPacket.java index ee1b200a..f0e317ad 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundClientInformationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundClientInformationPacket.java @@ -72,4 +72,10 @@ public class ServerboundClientInformationPacket implements MinecraftPacket { out.writeBoolean(allowsListing); helper.writeVarInt(out, this.particleStatus.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + // GAME THREAD DETAIL: Code is only async during GAME state. + return false; // False, you need to handle making it async yourself + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundResourcePackPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundResourcePackPacket.java index 1bdcef7f..c2944d93 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundResourcePackPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundResourcePackPacket.java @@ -29,4 +29,9 @@ public class ServerboundResourcePackPacket implements MinecraftPacket { helper.writeUUID(out, id); helper.writeVarInt(out, this.status.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundFinishConfigurationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundFinishConfigurationPacket.java index f248a38c..69549f6d 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundFinishConfigurationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundFinishConfigurationPacket.java @@ -16,6 +16,11 @@ public class ClientboundFinishConfigurationPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + @Override public boolean isTerminal() { return true; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundRegistryDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundRegistryDataPacket.java index 9512ef4a..6f5fd3d9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundRegistryDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundRegistryDataPacket.java @@ -31,4 +31,9 @@ public class ClientboundRegistryDataPacket implements MinecraftPacket { helper.writeNullable(buf, entry.getData(), helper::writeAnyTag); }); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundSelectKnownPacks.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundSelectKnownPacks.java index e5dfa96f..c7e2c748 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundSelectKnownPacks.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundSelectKnownPacks.java @@ -28,4 +28,9 @@ public class ClientboundSelectKnownPacks implements MinecraftPacket { helper.writeString(buf, entry.getVersion()); }); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundFinishConfigurationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundFinishConfigurationPacket.java index 75147f6c..d3d68b2a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundFinishConfigurationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundFinishConfigurationPacket.java @@ -16,6 +16,11 @@ public class ServerboundFinishConfigurationPacket implements MinecraftPacket { public void serialize(ByteBuf buf, MinecraftCodecHelper helper) { } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + @Override public boolean isTerminal() { return true; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundSelectKnownPacks.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundSelectKnownPacks.java index d8cfd6d7..12f67f5c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundSelectKnownPacks.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundSelectKnownPacks.java @@ -39,4 +39,9 @@ public class ServerboundSelectKnownPacks implements MinecraftPacket { helper.writeString(out, entry.getVersion()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCookieRequestPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/clientbound/ClientboundCookieRequestPacket.java similarity index 82% rename from protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCookieRequestPacket.java rename to protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/clientbound/ClientboundCookieRequestPacket.java index df2ed423..29c77cac 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCookieRequestPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/clientbound/ClientboundCookieRequestPacket.java @@ -1,4 +1,4 @@ -package org.geysermc.mcprotocollib.protocol.packet.common.clientbound; +package org.geysermc.mcprotocollib.protocol.packet.cookie.clientbound; import io.netty.buffer.ByteBuf; import lombok.AllArgsConstructor; @@ -22,4 +22,9 @@ public class ClientboundCookieRequestPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeResourceLocation(out, this.key); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ServerboundCookieResponsePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/serverbound/ServerboundCookieResponsePacket.java similarity index 93% rename from protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ServerboundCookieResponsePacket.java rename to protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/serverbound/ServerboundCookieResponsePacket.java index 66afbff0..6f831cb4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ServerboundCookieResponsePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/serverbound/ServerboundCookieResponsePacket.java @@ -1,4 +1,4 @@ -package org.geysermc.mcprotocollib.protocol.packet.common.clientbound; +package org.geysermc.mcprotocollib.protocol.packet.cookie.serverbound; import io.netty.buffer.ByteBuf; import lombok.AllArgsConstructor; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/handshake/serverbound/ClientIntentionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/handshake/serverbound/ClientIntentionPacket.java index d1799dbc..b1d01b5e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/handshake/serverbound/ClientIntentionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/handshake/serverbound/ClientIntentionPacket.java @@ -33,11 +33,6 @@ public class ClientIntentionPacket implements MinecraftPacket { helper.writeVarInt(out, this.intent.ordinal() + 1); } - @Override - public boolean isPriority() { - return true; - } - @Override public boolean isTerminal() { return true; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundAwardStatsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundAwardStatsPacket.java index 3c281514..d2fdaf89 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundAwardStatsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundAwardStatsPacket.java @@ -91,4 +91,9 @@ public class ClientboundAwardStatsPacket implements MinecraftPacket { helper.writeVarInt(out, entry.getIntValue()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBossEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBossEventPacket.java index 3e4aef6d..fb3acf91 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBossEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBossEventPacket.java @@ -138,4 +138,9 @@ public class ClientboundBossEventPacket implements MinecraftPacket { out.writeByte(flags); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBundlePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBundlePacket.java index 8bf5c7a8..8da8f173 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBundlePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBundlePacket.java @@ -16,4 +16,9 @@ public class ClientboundBundlePacket implements MinecraftPacket { @Override public void serialize(ByteBuf buf, MinecraftCodecHelper helper) { } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundChangeDifficultyPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundChangeDifficultyPacket.java index e0d6af7b..c2370a70 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundChangeDifficultyPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundChangeDifficultyPacket.java @@ -26,4 +26,9 @@ public class ClientboundChangeDifficultyPacket implements MinecraftPacket { out.writeByte(this.difficulty.ordinal()); out.writeBoolean(this.difficultyLocked); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandSuggestionsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandSuggestionsPacket.java index ccf5b8ae..9fd73fb4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandSuggestionsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandSuggestionsPacket.java @@ -62,4 +62,9 @@ public class ClientboundCommandSuggestionsPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandsPacket.java index 9187c49a..d9954acd 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandsPacket.java @@ -300,4 +300,9 @@ public class ClientboundCommandsPacket implements MinecraftPacket { helper.writeVarInt(out, this.firstNodeIndex); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCooldownPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCooldownPacket.java index 4495db6b..2f47092d 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCooldownPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCooldownPacket.java @@ -25,4 +25,9 @@ public class ClientboundCooldownPacket implements MinecraftPacket { helper.writeResourceLocation(out, this.cooldownGroup); helper.writeVarInt(out, this.cooldownTicks); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCustomChatCompletionsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCustomChatCompletionsPacket.java index 4192925f..a612d097 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCustomChatCompletionsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCustomChatCompletionsPacket.java @@ -31,4 +31,9 @@ public class ClientboundCustomChatCompletionsPacket implements MinecraftPacket { helper.writeString(out, entry); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDeleteChatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDeleteChatPacket.java index 66a5ee4c..62f6f903 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDeleteChatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDeleteChatPacket.java @@ -25,4 +25,9 @@ public class ClientboundDeleteChatPacket implements MinecraftPacket { out.writeBytes(messageSignature.getMessageSignature()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDisguisedChatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDisguisedChatPacket.java index 15d236e9..01de2bee 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDisguisedChatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDisguisedChatPacket.java @@ -35,4 +35,9 @@ public class ClientboundDisguisedChatPacket implements MinecraftPacket { helper.writeComponent(out, this.name); helper.writeNullable(out, this.targetName, helper::writeComponent); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundLoginPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundLoginPacket.java index 8465b904..f2c0d385 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundLoginPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundLoginPacket.java @@ -61,4 +61,9 @@ public class ClientboundLoginPacket implements MinecraftPacket { helper.writePlayerSpawnInfo(out, this.commonPlayerSpawnInfo); out.writeBoolean(this.enforcesSecureChat); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerChatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerChatPacket.java index 746f0792..672369f9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerChatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerChatPacket.java @@ -84,4 +84,9 @@ public class ClientboundPlayerChatPacket implements MinecraftPacket { helper.writeComponent(out, this.name); helper.writeNullable(out, this.targetName, helper::writeComponent); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoRemovePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoRemovePacket.java index 041534e7..09807c08 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoRemovePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoRemovePacket.java @@ -23,4 +23,9 @@ public class ClientboundPlayerInfoRemovePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeList(out, this.profileIds, helper::writeUUID); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoUpdatePacket.java index bf24e958..ad7e5b33 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoUpdatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoUpdatePacket.java @@ -127,4 +127,9 @@ public class ClientboundPlayerInfoUpdatePacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookAddPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookAddPacket.java index 9ff4208c..9a0aeebc 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookAddPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookAddPacket.java @@ -60,6 +60,11 @@ public class ClientboundRecipeBookAddPacket implements MinecraftPacket { out.writeBoolean(this.replace); } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + public record Entry(RecipeDisplayEntry contents, boolean notification, boolean highlight) { } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookRemovePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookRemovePacket.java index 6f8f311d..38598ef4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookRemovePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookRemovePacket.java @@ -29,4 +29,9 @@ public class ClientboundRecipeBookRemovePacket implements MinecraftPacket { helper.writeVarInt(out, recipe); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookSettingsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookSettingsPacket.java index 57e40587..6fc53a17 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookSettingsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookSettingsPacket.java @@ -38,6 +38,11 @@ public class ClientboundRecipeBookSettingsPacket implements MinecraftPacket { } } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + private record TypeSettings(boolean open, boolean filtering) { } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRespawnPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRespawnPacket.java index 555ea176..4a1cc0fb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRespawnPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRespawnPacket.java @@ -39,4 +39,9 @@ public class ClientboundRespawnPacket implements MinecraftPacket { } out.writeByte(dataToKeep); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSelectAdvancementsTabPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSelectAdvancementsTabPacket.java index a38e24bd..ccb551bb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSelectAdvancementsTabPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSelectAdvancementsTabPacket.java @@ -22,4 +22,9 @@ public class ClientboundSelectAdvancementsTabPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeNullable(out, this.tabId, helper::writeString); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundServerDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundServerDataPacket.java index 34f139e1..c1f8f7da 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundServerDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundServerDataPacket.java @@ -26,4 +26,9 @@ public class ClientboundServerDataPacket implements MinecraftPacket { helper.writeComponent(out, this.motd); helper.writeNullable(out, this.iconBytes, helper::writeByteArray); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSetCameraPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSetCameraPacket.java index 0cb0232e..6c5d6d3b 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSetCameraPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSetCameraPacket.java @@ -21,4 +21,9 @@ public class ClientboundSetCameraPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.cameraEntityId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSoundEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSoundEntityPacket.java index ec985958..d227d5b8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSoundEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSoundEntityPacket.java @@ -46,4 +46,9 @@ public class ClientboundSoundEntityPacket implements MinecraftPacket { out.writeFloat(this.pitch); out.writeLong(this.seed); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStartConfigurationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStartConfigurationPacket.java index d7844e6e..5510c57e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStartConfigurationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStartConfigurationPacket.java @@ -16,6 +16,11 @@ public class ClientboundStartConfigurationPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + @Override public boolean isTerminal() { return true; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStopSoundPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStopSoundPacket.java index cc20b54b..1d4c45c8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStopSoundPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStopSoundPacket.java @@ -55,4 +55,9 @@ public class ClientboundStopSoundPacket implements MinecraftPacket { helper.writeResourceLocation(out, this.sound); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSystemChatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSystemChatPacket.java index 682a9de4..9b799930 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSystemChatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSystemChatPacket.java @@ -25,4 +25,9 @@ public class ClientboundSystemChatPacket implements MinecraftPacket { helper.writeComponent(out, this.content); out.writeBoolean(this.overlay); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTabListPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTabListPacket.java index b80fdea4..fc1956ad 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTabListPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTabListPacket.java @@ -26,4 +26,9 @@ public class ClientboundTabListPacket implements MinecraftPacket { helper.writeComponent(out, this.header); helper.writeComponent(out, this.footer); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStatePacket.java index fa468096..8f928d5e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStatePacket.java @@ -25,4 +25,9 @@ public class ClientboundTickingStatePacket implements MinecraftPacket { out.writeFloat(tickRate); out.writeBoolean(isFrozen); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStepPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStepPacket.java index 0898a134..4e53f5c4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStepPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStepPacket.java @@ -22,4 +22,9 @@ public class ClientboundTickingStepPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.tickSteps); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateAdvancementsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateAdvancementsPacket.java index 8293a17c..ed900580 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateAdvancementsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateAdvancementsPacket.java @@ -166,4 +166,9 @@ public class ClientboundUpdateAdvancementsPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateRecipesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateRecipesPacket.java index 30a66cfa..46c495f5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateRecipesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateRecipesPacket.java @@ -60,4 +60,9 @@ public class ClientboundUpdateRecipesPacket implements MinecraftPacket { public record SelectableRecipe(Ingredient input, SlotDisplay recipe) { } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundAnimatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundAnimatePacket.java index 6dca267a..80e08033 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundAnimatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundAnimatePacket.java @@ -30,4 +30,9 @@ public class ClientboundAnimatePacket implements MinecraftPacket { out.writeByte(this.animation.getId()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundDamageEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundDamageEventPacket.java index a94a1239..aef01afc 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundDamageEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundDamageEventPacket.java @@ -41,4 +41,9 @@ public class ClientboundDamageEventPacket implements MinecraftPacket { out.writeBoolean(false); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityEventPacket.java index 84a2d07b..c3b363df 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityEventPacket.java @@ -26,4 +26,9 @@ public class ClientboundEntityEventPacket implements MinecraftPacket { out.writeInt(this.entityId); helper.writeEntityEvent(out, this.event); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityPositionSyncPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityPositionSyncPacket.java index 95d93b61..43786e1e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityPositionSyncPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityPositionSyncPacket.java @@ -41,4 +41,9 @@ public class ClientboundEntityPositionSyncPacket implements MinecraftPacket { out.writeFloat(this.xRot); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundHurtAnimationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundHurtAnimationPacket.java index d7a6b032..bb30ea71 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundHurtAnimationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundHurtAnimationPacket.java @@ -24,4 +24,9 @@ public class ClientboundHurtAnimationPacket implements MinecraftPacket { helper.writeVarInt(out, this.id); out.writeFloat(this.yaw); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosPacket.java index 5afa47e2..d7a2a21f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosPacket.java @@ -33,4 +33,9 @@ public class ClientboundMoveEntityPosPacket implements MinecraftPacket { out.writeShort((int) (this.moveZ * 4096)); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosRotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosRotPacket.java index ba561136..f690ec62 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosRotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosRotPacket.java @@ -39,4 +39,9 @@ public class ClientboundMoveEntityPosRotPacket implements MinecraftPacket { out.writeByte((byte) (this.pitch * 256 / 360)); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityRotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityRotPacket.java index 6099fc77..4599f9d4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityRotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityRotPacket.java @@ -30,4 +30,9 @@ public class ClientboundMoveEntityRotPacket implements MinecraftPacket { out.writeByte((byte) (this.pitch * 256 / 360)); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveMinecartPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveMinecartPacket.java index 0c1f8e0d..4968917d 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveMinecartPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveMinecartPacket.java @@ -50,4 +50,9 @@ public class ClientboundMoveMinecartPacket implements MinecraftPacket { output.writeFloat(lerpStep.weight()); }); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveVehiclePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveVehiclePacket.java index 385f2424..8250528a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveVehiclePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveVehiclePacket.java @@ -30,4 +30,9 @@ public class ClientboundMoveVehiclePacket implements MinecraftPacket { out.writeFloat(this.yRot); out.writeFloat(this.xRot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundProjectilePowerPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundProjectilePowerPacket.java index 81f41311..4093f786 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundProjectilePowerPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundProjectilePowerPacket.java @@ -24,4 +24,9 @@ public class ClientboundProjectilePowerPacket implements MinecraftPacket { helper.writeVarInt(out, this.id); out.writeDouble(this.accelerationPower); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveEntitiesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveEntitiesPacket.java index 96dc1b0e..44aba673 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveEntitiesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveEntitiesPacket.java @@ -28,4 +28,9 @@ public class ClientboundRemoveEntitiesPacket implements MinecraftPacket { helper.writeVarInt(out, entityId); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveMobEffectPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveMobEffectPacket.java index 81ac0968..b6fc0da1 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveMobEffectPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveMobEffectPacket.java @@ -26,4 +26,9 @@ public class ClientboundRemoveMobEffectPacket implements MinecraftPacket { helper.writeVarInt(out, this.entityId); helper.writeEffect(out, this.effect); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRotateHeadPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRotateHeadPacket.java index 3b769fd5..ab5197c0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRotateHeadPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRotateHeadPacket.java @@ -24,4 +24,9 @@ public class ClientboundRotateHeadPacket implements MinecraftPacket { helper.writeVarInt(out, this.entityId); out.writeByte((byte) (this.headYaw * 256 / 360)); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityDataPacket.java index 22081f45..bf0c8038 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityDataPacket.java @@ -26,4 +26,9 @@ public class ClientboundSetEntityDataPacket implements MinecraftPacket { helper.writeVarInt(out, this.entityId); helper.writeEntityMetadata(out, this.metadata); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityLinkPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityLinkPacket.java index d91fd9e1..b1da4dba 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityLinkPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityLinkPacket.java @@ -24,4 +24,9 @@ public class ClientboundSetEntityLinkPacket implements MinecraftPacket { out.writeInt(this.entityId); out.writeInt(this.attachedToId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityMotionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityMotionPacket.java index fe2c9617..58ff798c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityMotionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityMotionPacket.java @@ -30,4 +30,9 @@ public class ClientboundSetEntityMotionPacket implements MinecraftPacket { out.writeShort((int) (this.motionY * 8000)); out.writeShort((int) (this.motionZ * 8000)); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEquipmentPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEquipmentPacket.java index fc2973f4..40c9d68e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEquipmentPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEquipmentPacket.java @@ -47,4 +47,9 @@ public class ClientboundSetEquipmentPacket implements MinecraftPacket { helper.writeOptionalItemStack(out, this.equipment[i].getItem()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetPassengersPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetPassengersPacket.java index 2a479e7b..0bdee16e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetPassengersPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetPassengersPacket.java @@ -31,4 +31,9 @@ public class ClientboundSetPassengersPacket implements MinecraftPacket { helper.writeVarInt(out, entityId); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTakeItemEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTakeItemEntityPacket.java index 5e28f50e..b9f4e227 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTakeItemEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTakeItemEntityPacket.java @@ -27,4 +27,9 @@ public class ClientboundTakeItemEntityPacket implements MinecraftPacket { helper.writeVarInt(out, this.collectorEntityId); helper.writeVarInt(out, this.itemCount); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTeleportEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTeleportEntityPacket.java index ee538fe8..2e3b16a4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTeleportEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTeleportEntityPacket.java @@ -64,4 +64,9 @@ public class ClientboundTeleportEntityPacket implements MinecraftPacket { out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateAttributesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateAttributesPacket.java index 4fe3b57f..e20ea7e9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateAttributesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateAttributesPacket.java @@ -54,4 +54,9 @@ public class ClientboundUpdateAttributesPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateMobEffectPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateMobEffectPacket.java index 985c2dfe..478e048c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateMobEffectPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateMobEffectPacket.java @@ -63,4 +63,9 @@ public class ClientboundUpdateMobEffectPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundBlockChangedAckPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundBlockChangedAckPacket.java index 9b1e1880..cf916aba 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundBlockChangedAckPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundBlockChangedAckPacket.java @@ -21,4 +21,9 @@ public class ClientboundBlockChangedAckPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.sequence); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerAbilitiesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerAbilitiesPacket.java index f18dfa58..071e728c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerAbilitiesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerAbilitiesPacket.java @@ -58,4 +58,9 @@ public class ClientboundPlayerAbilitiesPacket implements MinecraftPacket { out.writeFloat(this.flySpeed); out.writeFloat(this.walkSpeed); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerCombatKillPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerCombatKillPacket.java index 7dd83493..f4c94d38 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerCombatKillPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerCombatKillPacket.java @@ -25,4 +25,9 @@ public class ClientboundPlayerCombatKillPacket implements MinecraftPacket { helper.writeVarInt(out, this.playerId); helper.writeComponent(out, this.message); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerLookAtPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerLookAtPacket.java index c9862d03..a8f60bbb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerLookAtPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerLookAtPacket.java @@ -55,4 +55,9 @@ public class ClientboundPlayerLookAtPacket implements MinecraftPacket { out.writeBoolean(false); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerPositionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerPositionPacket.java index cb2b2d37..8057683f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerPositionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerPositionPacket.java @@ -66,4 +66,9 @@ public class ClientboundPlayerPositionPacket implements MinecraftPacket { out.writeInt(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerRotationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerRotationPacket.java index b9acd631..dd467efe 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerRotationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerRotationPacket.java @@ -24,4 +24,9 @@ public class ClientboundPlayerRotationPacket implements MinecraftPacket { out.writeFloat(this.yRot); out.writeFloat(this.xRot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetExperiencePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetExperiencePacket.java index ae1e9004..ff68090c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetExperiencePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetExperiencePacket.java @@ -27,4 +27,9 @@ public class ClientboundSetExperiencePacket implements MinecraftPacket { helper.writeVarInt(out, this.level); helper.writeVarInt(out, this.totalExperience); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHealthPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHealthPacket.java index e6747eaa..43c99a87 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHealthPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHealthPacket.java @@ -27,4 +27,9 @@ public class ClientboundSetHealthPacket implements MinecraftPacket { helper.writeVarInt(out, this.food); out.writeFloat(this.saturation); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHeldSlotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHeldSlotPacket.java index e8104557..d889de68 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHeldSlotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHeldSlotPacket.java @@ -21,4 +21,9 @@ public class ClientboundSetHeldSlotPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.slot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddEntityPacket.java index 14213e0e..f6aa245e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddEntityPacket.java @@ -120,4 +120,9 @@ public class ClientboundAddEntityPacket implements MinecraftPacket { out.writeShort((int) (this.motionY * 8000)); out.writeShort((int) (this.motionZ * 8000)); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddExperienceOrbPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddExperienceOrbPacket.java index d5531bbb..ece0a369 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddExperienceOrbPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddExperienceOrbPacket.java @@ -33,4 +33,9 @@ public class ClientboundAddExperienceOrbPacket implements MinecraftPacket { out.writeDouble(this.z); out.writeShort(this.exp); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerClosePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerClosePacket.java index f742482e..b8d9f214 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerClosePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerClosePacket.java @@ -21,4 +21,9 @@ public class ClientboundContainerClosePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.containerId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetContentPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetContentPacket.java index a1450c77..5ba70983 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetContentPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetContentPacket.java @@ -39,4 +39,9 @@ public class ClientboundContainerSetContentPacket implements MinecraftPacket { } helper.writeOptionalItemStack(out, this.carriedItem); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetDataPacket.java index 7e3aaec7..51a37322 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetDataPacket.java @@ -32,4 +32,9 @@ public class ClientboundContainerSetDataPacket implements MinecraftPacket { out.writeShort(this.rawProperty); out.writeShort(this.value); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetSlotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetSlotPacket.java index ee30f776..e48889b8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetSlotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetSlotPacket.java @@ -32,4 +32,9 @@ public class ClientboundContainerSetSlotPacket implements MinecraftPacket { out.writeShort(this.slot); helper.writeOptionalItemStack(out, this.item); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundHorseScreenOpenPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundHorseScreenOpenPacket.java index 9481bc30..f9c15d20 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundHorseScreenOpenPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundHorseScreenOpenPacket.java @@ -27,4 +27,9 @@ public class ClientboundHorseScreenOpenPacket implements MinecraftPacket { helper.writeVarInt(out, this.inventoryColumns); out.writeInt(this.entityId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundMerchantOffersPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundMerchantOffersPacket.java index aef6a66d..cf33181c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundMerchantOffersPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundMerchantOffersPacket.java @@ -72,4 +72,9 @@ public class ClientboundMerchantOffersPacket implements MinecraftPacket { out.writeBoolean(this.regularVillager); out.writeBoolean(this.canRestock); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenBookPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenBookPacket.java index 55f5f2fe..efeced26 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenBookPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenBookPacket.java @@ -23,4 +23,9 @@ public class ClientboundOpenBookPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.hand.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenScreenPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenScreenPacket.java index 19313388..22eaa4de 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenScreenPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenScreenPacket.java @@ -48,4 +48,9 @@ public class ClientboundOpenScreenPacket implements MinecraftPacket { public ClientboundOpenScreenPacket withName(String name) { return new ClientboundOpenScreenPacket(this.containerId, this.type, DefaultComponentSerializer.get().deserialize(name)); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundPlaceGhostRecipePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundPlaceGhostRecipePacket.java index 6b15fc25..40d6c426 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundPlaceGhostRecipePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundPlaceGhostRecipePacket.java @@ -26,4 +26,9 @@ public class ClientboundPlaceGhostRecipePacket implements MinecraftPacket { helper.writeVarInt(out, this.containerId); helper.writeRecipeDisplay(out, this.recipeDisplay); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetCursorItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetCursorItemPacket.java index 643a1f73..220f56eb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetCursorItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetCursorItemPacket.java @@ -22,4 +22,9 @@ public class ClientboundSetCursorItemPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeOptionalItemStack(out, this.contents); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetPlayerInventoryPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetPlayerInventoryPacket.java index a7c929fc..403d1aa7 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetPlayerInventoryPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetPlayerInventoryPacket.java @@ -25,4 +25,9 @@ public class ClientboundSetPlayerInventoryPacket implements MinecraftPacket { helper.writeVarInt(out, this.slot); helper.writeOptionalItemStack(out, this.contents); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockDestructionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockDestructionPacket.java index 76c0955b..abadbfa9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockDestructionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockDestructionPacket.java @@ -30,4 +30,9 @@ public class ClientboundBlockDestructionPacket implements MinecraftPacket { helper.writePosition(out, this.position); helper.writeBlockBreakStage(out, this.stage); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEntityDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEntityDataPacket.java index d1131712..89006523 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEntityDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEntityDataPacket.java @@ -32,4 +32,9 @@ public class ClientboundBlockEntityDataPacket implements MinecraftPacket { helper.writeBlockEntityType(out, this.type); helper.writeAnyTag(out, this.nbt); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEventPacket.java index e88f77f9..369f85ba 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEventPacket.java @@ -115,4 +115,9 @@ public class ClientboundBlockEventPacket implements MinecraftPacket { out.writeByte(val); helper.writeVarInt(out, this.blockId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockUpdatePacket.java index 05b60eb5..62899485 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockUpdatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockUpdatePacket.java @@ -24,4 +24,9 @@ public class ClientboundBlockUpdatePacket implements MinecraftPacket { helper.writePosition(out, this.entry.getPosition()); helper.writeVarInt(out, this.entry.getBlock()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundChunksBiomesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundChunksBiomesPacket.java index 6d5a8757..f0096085 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundChunksBiomesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundChunksBiomesPacket.java @@ -29,4 +29,9 @@ public class ClientboundChunksBiomesPacket implements MinecraftPacket { helper.writeByteArray(buf, entry.getBuffer()); }); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundExplodePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundExplodePacket.java index d2468acf..ee141239 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundExplodePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundExplodePacket.java @@ -48,4 +48,9 @@ public class ClientboundExplodePacket implements MinecraftPacket { helper.writeVarInt(out, ((BuiltinSound) this.explosionSound).ordinal() + 1); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundForgetLevelChunkPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundForgetLevelChunkPacket.java index 9eeeb869..2be520d3 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundForgetLevelChunkPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundForgetLevelChunkPacket.java @@ -24,4 +24,9 @@ public class ClientboundForgetLevelChunkPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeLong(this.x & 0xFFFFFFFFL | (this.z & 0xFFFFFFFFL) << 32); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundGameEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundGameEventPacket.java index 5b033612..360cd891 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundGameEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundGameEventPacket.java @@ -67,4 +67,9 @@ public class ClientboundGameEventPacket implements MinecraftPacket { out.writeFloat(value); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelChunkWithLightPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelChunkWithLightPacket.java index 32f9aaf0..a8e61b25 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelChunkWithLightPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelChunkWithLightPacket.java @@ -61,4 +61,9 @@ public class ClientboundLevelChunkWithLightPacket implements MinecraftPacket { helper.writeLightUpdateData(out, this.lightData); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelEventPacket.java index acd0eed3..03c02349 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelEventPacket.java @@ -96,4 +96,9 @@ public class ClientboundLevelEventPacket implements MinecraftPacket { out.writeInt(value); out.writeBoolean(this.broadcast); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelParticlesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelParticlesPacket.java index 7aa273de..8df73b43 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelParticlesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelParticlesPacket.java @@ -56,4 +56,9 @@ public class ClientboundLevelParticlesPacket implements MinecraftPacket { helper.writeParticleType(out, this.particle.getType()); helper.writeParticleData(out, this.particle.getType(), this.particle.getData()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLightUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLightUpdatePacket.java index 5936d1b3..0cc8e757 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLightUpdatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLightUpdatePacket.java @@ -50,4 +50,9 @@ public class ClientboundLightUpdatePacket implements MinecraftPacket { helper.writeVarInt(out, this.z); helper.writeLightUpdateData(out, this.lightData); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundMapItemDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundMapItemDataPacket.java index 4837cfdb..a17e2365 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundMapItemDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundMapItemDataPacket.java @@ -89,4 +89,9 @@ public class ClientboundMapItemDataPacket implements MinecraftPacket { out.writeByte(0); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundOpenSignEditorPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundOpenSignEditorPacket.java index 648012a3..7aa3c71e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundOpenSignEditorPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundOpenSignEditorPacket.java @@ -26,4 +26,9 @@ public class ClientboundOpenSignEditorPacket implements MinecraftPacket { helper.writePosition(out, this.position); out.writeBoolean(this.isFrontText); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSectionBlocksUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSectionBlocksUpdatePacket.java index d086e63e..3a06ead2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSectionBlocksUpdatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSectionBlocksUpdatePacket.java @@ -59,4 +59,9 @@ public class ClientboundSectionBlocksUpdatePacket implements MinecraftPacket { helper.writeVarLong(out, (long) entry.getBlock() << 12 | (long) position); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheCenterPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheCenterPacket.java index bf91c0a1..0ad5d3e5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheCenterPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheCenterPacket.java @@ -24,4 +24,9 @@ public class ClientboundSetChunkCacheCenterPacket implements MinecraftPacket { helper.writeVarInt(out, this.chunkX); helper.writeVarInt(out, this.chunkZ); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheRadiusPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheRadiusPacket.java index f77f6776..f62ba2b6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheRadiusPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheRadiusPacket.java @@ -21,4 +21,9 @@ public class ClientboundSetChunkCacheRadiusPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.viewDistance); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetDefaultSpawnPositionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetDefaultSpawnPositionPacket.java index dfce1a77..33ecbf8c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetDefaultSpawnPositionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetDefaultSpawnPositionPacket.java @@ -26,4 +26,9 @@ public class ClientboundSetDefaultSpawnPositionPacket implements MinecraftPacket helper.writePosition(out, this.position); out.writeFloat(this.angle); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetSimulationDistancePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetSimulationDistancePacket.java index 4f42d483..fae66ec7 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetSimulationDistancePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetSimulationDistancePacket.java @@ -21,4 +21,9 @@ public class ClientboundSetSimulationDistancePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.simulationDistance); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetTimePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetTimePacket.java index cb47a7ee..42dc1d9b 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetTimePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetTimePacket.java @@ -27,4 +27,9 @@ public class ClientboundSetTimePacket implements MinecraftPacket { out.writeLong(this.dayTime); out.writeBoolean(this.tickDayTime); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSoundPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSoundPacket.java index 039cf812..405773b9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSoundPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSoundPacket.java @@ -52,4 +52,9 @@ public class ClientboundSoundPacket implements MinecraftPacket { out.writeFloat(this.pitch); out.writeLong(this.seed); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundTagQueryPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundTagQueryPacket.java index 260cbf46..cffebe1c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundTagQueryPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundTagQueryPacket.java @@ -26,4 +26,9 @@ public class ClientboundTagQueryPacket implements MinecraftPacket { helper.writeVarInt(out, this.transactionId); helper.writeAnyTag(out, this.nbt); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundInitializeBorderPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundInitializeBorderPacket.java index a6af2fba..2df7809f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundInitializeBorderPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundInitializeBorderPacket.java @@ -42,4 +42,9 @@ public class ClientboundInitializeBorderPacket implements MinecraftPacket { helper.writeVarInt(out, this.warningBlocks); helper.writeVarInt(out, this.warningTime); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderCenterPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderCenterPacket.java index 89d033a6..a3b995b3 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderCenterPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderCenterPacket.java @@ -24,4 +24,9 @@ public class ClientboundSetBorderCenterPacket implements MinecraftPacket { out.writeDouble(this.newCenterX); out.writeDouble(this.newCenterZ); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderLerpSizePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderLerpSizePacket.java index 722b8e4a..124e6bf6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderLerpSizePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderLerpSizePacket.java @@ -27,4 +27,9 @@ public class ClientboundSetBorderLerpSizePacket implements MinecraftPacket { out.writeDouble(this.newSize); helper.writeVarLong(out, this.lerpTime); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderSizePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderSizePacket.java index e3487bd1..b2c765c6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderSizePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderSizePacket.java @@ -21,4 +21,9 @@ public class ClientboundSetBorderSizePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeDouble(this.size); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDelayPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDelayPacket.java index c5bca0b8..525c3347 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDelayPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDelayPacket.java @@ -21,4 +21,9 @@ public class ClientboundSetBorderWarningDelayPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.warningDelay); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDistancePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDistancePacket.java index a6e5e281..1602c56b 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDistancePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDistancePacket.java @@ -21,4 +21,9 @@ public class ClientboundSetBorderWarningDistancePacket implements MinecraftPacke public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.warningBlocks); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundResetScorePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundResetScorePacket.java index 1769f683..4f8e728a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundResetScorePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundResetScorePacket.java @@ -27,4 +27,9 @@ public class ClientboundResetScorePacket implements MinecraftPacket { helper.writeString(out, this.owner); helper.writeNullable(out, this.objective, helper::writeString); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetDisplayObjectivePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetDisplayObjectivePacket.java index 65aec273..ad4902bc 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetDisplayObjectivePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetDisplayObjectivePacket.java @@ -26,4 +26,9 @@ public class ClientboundSetDisplayObjectivePacket implements MinecraftPacket { helper.writeVarInt(out, this.position.ordinal()); helper.writeString(out, this.name); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetObjectivePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetObjectivePacket.java index a316cb97..9906f5fc 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetObjectivePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetObjectivePacket.java @@ -83,4 +83,9 @@ public class ClientboundSetObjectivePacket implements MinecraftPacket { helper.writeNullable(out, this.numberFormat, helper::writeNumberFormat); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetPlayerTeamPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetPlayerTeamPacket.java index 4b4d1767..d15c03cf 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetPlayerTeamPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetPlayerTeamPacket.java @@ -166,4 +166,9 @@ public class ClientboundSetPlayerTeamPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetScorePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetScorePacket.java index 9bd5fadd..bf6aa617 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetScorePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetScorePacket.java @@ -49,4 +49,9 @@ public class ClientboundSetScorePacket implements MinecraftPacket { helper.writeNullable(out, this.display, helper::writeComponent); helper.writeNullable(out, this.numberFormat, helper::writeNumberFormat); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundClearTitlesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundClearTitlesPacket.java index f5832deb..d1ee6630 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundClearTitlesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundClearTitlesPacket.java @@ -21,4 +21,9 @@ public class ClientboundClearTitlesPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeBoolean(this.resetTimes); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetActionBarTextPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetActionBarTextPacket.java index 190ffc6e..2adb5f95 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetActionBarTextPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetActionBarTextPacket.java @@ -22,4 +22,9 @@ public class ClientboundSetActionBarTextPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeComponent(out, this.text); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetSubtitleTextPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetSubtitleTextPacket.java index 220fe1f9..5c6b9de8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetSubtitleTextPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetSubtitleTextPacket.java @@ -22,4 +22,9 @@ public class ClientboundSetSubtitleTextPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeComponent(out, this.text); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitleTextPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitleTextPacket.java index 890abbe6..e5ec2fab 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitleTextPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitleTextPacket.java @@ -23,4 +23,9 @@ public class ClientboundSetTitleTextPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeComponent(out, this.text); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitlesAnimationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitlesAnimationPacket.java index d5e02bbe..341d0cc5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitlesAnimationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitlesAnimationPacket.java @@ -27,4 +27,9 @@ public class ClientboundSetTitlesAnimationPacket implements MinecraftPacket { out.writeInt(this.stay); out.writeInt(this.fadeOut); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChangeDifficultyPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChangeDifficultyPacket.java index ba8790e5..74bee265 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChangeDifficultyPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChangeDifficultyPacket.java @@ -23,4 +23,9 @@ public class ServerboundChangeDifficultyPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeByte(this.difficulty.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChatSessionUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChatSessionUpdatePacket.java index c3934fee..e1c0564e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChatSessionUpdatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChatSessionUpdatePacket.java @@ -45,4 +45,9 @@ public class ServerboundChatSessionUpdatePacket implements MinecraftPacket { helper.writeByteArray(out, this.publicKey.getEncoded()); helper.writeByteArray(out, this.keySignature); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientCommandPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientCommandPacket.java index f13f49a7..646f797f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientCommandPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientCommandPacket.java @@ -23,4 +23,9 @@ public class ServerboundClientCommandPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.request.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientTickEndPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientTickEndPacket.java index 8b9381ee..ecebd1da 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientTickEndPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientTickEndPacket.java @@ -15,4 +15,9 @@ public class ServerboundClientTickEndPacket implements MinecraftPacket { @Override public void serialize(ByteBuf out, MinecraftCodecHelper helper) { } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundCommandSuggestionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundCommandSuggestionPacket.java index 2d004475..d39f25ba 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundCommandSuggestionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundCommandSuggestionPacket.java @@ -25,4 +25,9 @@ public class ServerboundCommandSuggestionPacket implements MinecraftPacket { helper.writeVarInt(out, this.transactionId); helper.writeString(out, this.text); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundDebugSampleSubscriptionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundDebugSampleSubscriptionPacket.java index d7781a69..780292b6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundDebugSampleSubscriptionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundDebugSampleSubscriptionPacket.java @@ -22,4 +22,9 @@ public class ServerboundDebugSampleSubscriptionPacket implements MinecraftPacket public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.debugSampleType.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundLockDifficultyPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundLockDifficultyPacket.java index 70be72a1..502eac9c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundLockDifficultyPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundLockDifficultyPacket.java @@ -21,4 +21,9 @@ public class ServerboundLockDifficultyPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeBoolean(this.locked); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundPlayerLoadedPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundPlayerLoadedPacket.java index 49f44411..2b22d44e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundPlayerLoadedPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundPlayerLoadedPacket.java @@ -15,4 +15,9 @@ public class ServerboundPlayerLoadedPacket implements MinecraftPacket { @Override public void serialize(ByteBuf out, MinecraftCodecHelper helper) { } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerButtonClickPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerButtonClickPacket.java index 44d44441..b707e2db 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerButtonClickPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerButtonClickPacket.java @@ -24,4 +24,9 @@ public class ServerboundContainerButtonClickPacket implements MinecraftPacket { helper.writeVarInt(out, this.containerId); helper.writeVarInt(out, this.buttonId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClickPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClickPacket.java index a6a02dad..ebd08b39 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClickPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClickPacket.java @@ -116,4 +116,9 @@ public class ServerboundContainerClickPacket implements MinecraftPacket { helper.writeOptionalItemStack(out, this.carriedItem); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClosePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClosePacket.java index e097f770..6bd7bd57 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClosePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClosePacket.java @@ -21,4 +21,9 @@ public class ServerboundContainerClosePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.containerId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerSlotStateChangedPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerSlotStateChangedPacket.java index 164cd111..17f3fe9f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerSlotStateChangedPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerSlotStateChangedPacket.java @@ -28,4 +28,9 @@ public class ServerboundContainerSlotStateChangedPacket implements MinecraftPack helper.writeVarInt(out, this.containerId); out.writeBoolean(this.newState); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemFromBlockPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemFromBlockPacket.java index 1d89c256..513fa57f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemFromBlockPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemFromBlockPacket.java @@ -25,4 +25,9 @@ public class ServerboundPickItemFromBlockPacket implements MinecraftPacket { helper.writePosition(out, this.pos); out.writeBoolean(this.includeData); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemFromEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemFromEntityPacket.java index 3ff338bf..946d29c0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemFromEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemFromEntityPacket.java @@ -24,4 +24,9 @@ public class ServerboundPickItemFromEntityPacket implements MinecraftPacket { helper.writeVarInt(out, this.id); out.writeBoolean(this.includeData); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPlaceRecipePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPlaceRecipePacket.java index 5717139f..5d54db2e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPlaceRecipePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPlaceRecipePacket.java @@ -28,4 +28,9 @@ public class ServerboundPlaceRecipePacket implements MinecraftPacket { helper.writeVarInt(out, this.recipe); out.writeBoolean(this.useMaxItems); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookChangeSettingsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookChangeSettingsPacket.java index 3d22b0c1..0781b189 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookChangeSettingsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookChangeSettingsPacket.java @@ -29,4 +29,9 @@ public class ServerboundRecipeBookChangeSettingsPacket implements MinecraftPacke out.writeBoolean(this.bookOpen); out.writeBoolean(this.filterActive); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookSeenRecipePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookSeenRecipePacket.java index d7569ee2..82970593 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookSeenRecipePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookSeenRecipePacket.java @@ -22,4 +22,9 @@ public class ServerboundRecipeBookSeenRecipePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.recipe); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRenameItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRenameItemPacket.java index c9dbe233..dfc30953 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRenameItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRenameItemPacket.java @@ -22,4 +22,9 @@ public class ServerboundRenameItemPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeString(out, this.name); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSeenAdvancementsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSeenAdvancementsPacket.java index f0f9a3d9..c4bcb874 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSeenAdvancementsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSeenAdvancementsPacket.java @@ -58,4 +58,9 @@ public class ServerboundSeenAdvancementsPacket implements MinecraftPacket { }; tabIdWriter.accept(this.tabId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSelectTradePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSelectTradePacket.java index e32fc3b2..d6403ab0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSelectTradePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSelectTradePacket.java @@ -21,4 +21,9 @@ public class ServerboundSelectTradePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.slot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetBeaconPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetBeaconPacket.java index 9540a7b2..c1d01369 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetBeaconPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetBeaconPacket.java @@ -42,4 +42,9 @@ public class ServerboundSetBeaconPacket implements MinecraftPacket { helper.writeVarInt(out, this.secondaryEffect.getAsInt()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandBlockPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandBlockPacket.java index c15cfd6d..5c010b02 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandBlockPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandBlockPacket.java @@ -57,4 +57,9 @@ public class ServerboundSetCommandBlockPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandMinecartPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandMinecartPacket.java index 8adb43e4..00916596 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandMinecartPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandMinecartPacket.java @@ -28,4 +28,9 @@ public class ServerboundSetCommandMinecartPacket implements MinecraftPacket { helper.writeString(out, this.command); out.writeBoolean(this.doesTrackOutput); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCreativeModeSlotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCreativeModeSlotPacket.java index 35c5c0e6..66f7d2e4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCreativeModeSlotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCreativeModeSlotPacket.java @@ -26,4 +26,9 @@ public class ServerboundSetCreativeModeSlotPacket implements MinecraftPacket { out.writeShort(this.slot); helper.writeOptionalItemStack(out, this.clickedItem); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetJigsawBlockPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetJigsawBlockPacket.java index d49dc500..03c34443 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetJigsawBlockPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetJigsawBlockPacket.java @@ -45,4 +45,9 @@ public class ServerboundSetJigsawBlockPacket implements MinecraftPacket { helper.writeVarInt(out, this.selectionPriority); helper.writeVarInt(out, this.placementPriority); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetStructureBlockPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetStructureBlockPacket.java index ccbec960..30042ca0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetStructureBlockPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetStructureBlockPacket.java @@ -88,4 +88,9 @@ public class ServerboundSetStructureBlockPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundAcceptTeleportationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundAcceptTeleportationPacket.java index 95cbe531..fb4657d1 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundAcceptTeleportationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundAcceptTeleportationPacket.java @@ -21,4 +21,9 @@ public class ServerboundAcceptTeleportationPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.id); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundBlockEntityTagQueryPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundBlockEntityTagQueryPacket.java index 6aa8b090..b8cf0042 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundBlockEntityTagQueryPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundBlockEntityTagQueryPacket.java @@ -26,4 +26,9 @@ public class ServerboundBlockEntityTagQueryPacket implements MinecraftPacket { helper.writeVarInt(out, this.transactionId); helper.writePosition(out, this.position); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundChunkBatchReceivedPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundChunkBatchReceivedPacket.java index 3f981a2e..6a07dbe6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundChunkBatchReceivedPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundChunkBatchReceivedPacket.java @@ -20,4 +20,9 @@ public class ServerboundChunkBatchReceivedPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeFloat(this.desiredChunksPerTick); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundEntityTagQuery.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundEntityTagQuery.java index 24160596..54399cf3 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundEntityTagQuery.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundEntityTagQuery.java @@ -24,4 +24,9 @@ public class ServerboundEntityTagQuery implements MinecraftPacket { helper.writeVarInt(out, this.transactionId); helper.writeVarInt(out, this.entityId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundJigsawGeneratePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundJigsawGeneratePacket.java index 3febebaf..5fc4e305 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundJigsawGeneratePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundJigsawGeneratePacket.java @@ -29,4 +29,9 @@ public class ServerboundJigsawGeneratePacket implements MinecraftPacket { helper.writeVarInt(out, this.levels); out.writeBoolean(this.keepJigsaws); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundMoveVehiclePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundMoveVehiclePacket.java index 36816394..a558a0eb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundMoveVehiclePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundMoveVehiclePacket.java @@ -33,4 +33,9 @@ public class ServerboundMoveVehiclePacket implements MinecraftPacket { out.writeFloat(this.xRot); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPaddleBoatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPaddleBoatPacket.java index 8bacc3fa..0bb4eaf4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPaddleBoatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPaddleBoatPacket.java @@ -24,4 +24,9 @@ public class ServerboundPaddleBoatPacket implements MinecraftPacket { out.writeBoolean(this.rightPaddleTurning); out.writeBoolean(this.leftPaddleTurning); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPlayerInputPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPlayerInputPacket.java index fa9ce70e..a8dff3d0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPlayerInputPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPlayerInputPacket.java @@ -71,4 +71,9 @@ public class ServerboundPlayerInputPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundTeleportToEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundTeleportToEntityPacket.java index d45f2323..3118904a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundTeleportToEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundTeleportToEntityPacket.java @@ -24,4 +24,9 @@ public class ServerboundTeleportToEntityPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeUUID(out, this.target); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundInteractPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundInteractPacket.java index f95daa95..98d0b0b0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundInteractPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundInteractPacket.java @@ -67,4 +67,9 @@ public class ServerboundInteractPacket implements MinecraftPacket { } out.writeBoolean(this.isSneaking); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosPacket.java index da61a51d..5e7f2548 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosPacket.java @@ -42,4 +42,9 @@ public class ServerboundMovePlayerPosPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosRotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosRotPacket.java index da8a9867..9d187cd5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosRotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosRotPacket.java @@ -48,4 +48,9 @@ public class ServerboundMovePlayerPosRotPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerRotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerRotPacket.java index d05b4793..f3582b7d 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerRotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerRotPacket.java @@ -39,4 +39,9 @@ public class ServerboundMovePlayerRotPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerStatusOnlyPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerStatusOnlyPacket.java index 9a094612..794e28a8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerStatusOnlyPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerStatusOnlyPacket.java @@ -33,4 +33,9 @@ public class ServerboundMovePlayerStatusOnlyPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerAbilitiesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerAbilitiesPacket.java index 2410115a..754b4fc5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerAbilitiesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerAbilitiesPacket.java @@ -30,4 +30,9 @@ public class ServerboundPlayerAbilitiesPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerActionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerActionPacket.java index 0d308496..67abac25 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerActionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerActionPacket.java @@ -34,4 +34,9 @@ public class ServerboundPlayerActionPacket implements MinecraftPacket { out.writeByte(this.face.ordinal()); helper.writeVarInt(out, this.sequence); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerCommandPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerCommandPacket.java index 5ef559c1..00c2a2d8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerCommandPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerCommandPacket.java @@ -33,4 +33,9 @@ public class ServerboundPlayerCommandPacket implements MinecraftPacket { helper.writeVarInt(out, this.state.ordinal()); helper.writeVarInt(out, this.jumpBoost); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSetCarriedItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSetCarriedItemPacket.java index 26a0a7cd..4dd18d9f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSetCarriedItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSetCarriedItemPacket.java @@ -21,4 +21,9 @@ public class ServerboundSetCarriedItemPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeShort(this.slot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSwingPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSwingPacket.java index 744e454e..0beaaf73 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSwingPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSwingPacket.java @@ -23,4 +23,9 @@ public class ServerboundSwingPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.hand.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemOnPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemOnPacket.java index b20f208c..d1f5c5aa 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemOnPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemOnPacket.java @@ -49,4 +49,9 @@ public class ServerboundUseItemOnPacket implements MinecraftPacket { out.writeBoolean(this.hitWorldBorder); helper.writeVarInt(out, this.sequence); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemPacket.java index bdf92639..19c7b9f6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemPacket.java @@ -32,4 +32,9 @@ public class ServerboundUseItemPacket implements MinecraftPacket { out.writeFloat(this.yRot); out.writeFloat(this.xRot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundHelloPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundHelloPacket.java index 144ddaed..4ae1f019 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundHelloPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundHelloPacket.java @@ -43,9 +43,4 @@ public class ClientboundHelloPacket implements MinecraftPacket { helper.writeByteArray(out, this.challenge); out.writeBoolean(this.shouldAuthenticate); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginCompressionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginCompressionPacket.java index 26a9fba9..33ee3410 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginCompressionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginCompressionPacket.java @@ -21,9 +21,4 @@ public class ClientboundLoginCompressionPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.threshold); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginDisconnectPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginDisconnectPacket.java index 44441204..37a1b291 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginDisconnectPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginDisconnectPacket.java @@ -32,9 +32,4 @@ public class ClientboundLoginDisconnectPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeString(out, DefaultComponentSerializer.get().serialize(reason)); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginFinishedPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginFinishedPacket.java index 7181477e..da156a9c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginFinishedPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginFinishedPacket.java @@ -28,11 +28,6 @@ public class ClientboundLoginFinishedPacket implements MinecraftPacket { helper.writeList(out, this.profile.getProperties(), helper::writeProperty); } - @Override - public boolean isPriority() { - return true; - } - @Override public boolean isTerminal() { return true; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundHelloPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundHelloPacket.java index 0691788a..141834e7 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundHelloPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundHelloPacket.java @@ -27,9 +27,4 @@ public class ServerboundHelloPacket implements MinecraftPacket { helper.writeString(out, this.username); helper.writeUUID(out, this.profileId); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundKeyPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundKeyPacket.java index d4337237..65415e26 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundKeyPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundKeyPacket.java @@ -45,11 +45,6 @@ public class ServerboundKeyPacket implements MinecraftPacket { helper.writeByteArray(out, this.encryptedChallenge); } - @Override - public boolean isPriority() { - return true; - } - private static byte[] runEncryption(int mode, Key key, byte[] data) { try { Cipher cipher = Cipher.getInstance(key.getAlgorithm().equals("RSA") ? "RSA/ECB/PKCS1Padding" : "AES/CFB8/NoPadding"); diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/clientbound/ClientboundPongResponsePacket.java similarity index 90% rename from protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacket.java rename to protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/clientbound/ClientboundPongResponsePacket.java index 011a36f0..ff0d8b14 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/clientbound/ClientboundPongResponsePacket.java @@ -1,4 +1,4 @@ -package org.geysermc.mcprotocollib.protocol.packet.status.clientbound; +package org.geysermc.mcprotocollib.protocol.packet.ping.clientbound; import io.netty.buffer.ByteBuf; import lombok.AllArgsConstructor; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/serverbound/ServerboundPingRequestPacket.java similarity index 90% rename from protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacket.java rename to protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/serverbound/ServerboundPingRequestPacket.java index ef9b16ba..dceb274c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/serverbound/ServerboundPingRequestPacket.java @@ -1,4 +1,4 @@ -package org.geysermc.mcprotocollib.protocol.packet.status.serverbound; +package org.geysermc.mcprotocollib.protocol.packet.ping.serverbound; import io.netty.buffer.ByteBuf; import lombok.AllArgsConstructor; diff --git a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacketTest.java b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacketTest.java index 52f609de..bda267ca 100644 --- a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacketTest.java +++ b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacketTest.java @@ -1,6 +1,7 @@ package org.geysermc.mcprotocollib.protocol.packet.status.clientbound; import org.geysermc.mcprotocollib.protocol.packet.PacketTest; +import org.geysermc.mcprotocollib.protocol.packet.ping.clientbound.ClientboundPongResponsePacket; import org.junit.jupiter.api.BeforeEach; public class ClientboundPongResponsePacketTest extends PacketTest { diff --git a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacketTest.java b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacketTest.java index 18c87782..c8e90d38 100644 --- a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacketTest.java +++ b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacketTest.java @@ -1,6 +1,7 @@ package org.geysermc.mcprotocollib.protocol.packet.status.serverbound; import org.geysermc.mcprotocollib.protocol.packet.PacketTest; +import org.geysermc.mcprotocollib.protocol.packet.ping.serverbound.ServerboundPingRequestPacket; import org.junit.jupiter.api.BeforeEach; public class ServerboundPingRequestPacketTest extends PacketTest {