mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-11-14 11:24:57 -05:00
Merge 5637fbedaf
into 8150091888
This commit is contained in:
commit
39937bbf8a
197 changed files with 950 additions and 91 deletions
|
@ -9,13 +9,14 @@ import org.geysermc.mcprotocollib.network.Session;
|
||||||
public interface Packet {
|
public interface Packet {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets whether the packet has handling priority.
|
* Gets whether the packet should run on an async game thread rather than blocking the network (Netty) thread.
|
||||||
* If the result is true, the packet will be handled immediately after being
|
* Packets that qualify for this are usually packets with an ensureRunningOnSameThread call at the top of their packet listener method in the Minecraft code.
|
||||||
* decoded.
|
* 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -43,6 +43,7 @@ import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.ThreadFactory;
|
import java.util.concurrent.ThreadFactory;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@ -76,7 +77,11 @@ public class TcpClientSession extends TcpSession {
|
||||||
}
|
}
|
||||||
|
|
||||||
public TcpClientSession(String host, int port, String bindAddress, int bindPort, PacketProtocol protocol, ProxyInfo proxy) {
|
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.bindAddress = bindAddress;
|
||||||
this.bindPort = bindPort;
|
this.bindPort = bindPort;
|
||||||
this.proxy = proxy;
|
this.proxy = proxy;
|
||||||
|
|
|
@ -13,7 +13,7 @@ public class TcpServerSession extends TcpSession {
|
||||||
private final PacketCodecHelper codecHelper;
|
private final PacketCodecHelper codecHelper;
|
||||||
|
|
||||||
public TcpServerSession(String host, int port, PacketProtocol protocol, TcpServer server) {
|
public TcpServerSession(String host, int port, PacketProtocol protocol, TcpServer server) {
|
||||||
super(host, port, protocol);
|
super(host, port, protocol, DefaultPacketHandlerExecutor.createExecutor());
|
||||||
this.server = server;
|
this.server = server;
|
||||||
this.codecHelper = protocol.createHelper();
|
this.codecHelper = protocol.createHelper();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,7 @@ package org.geysermc.mcprotocollib.network.tcp;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelFutureListener;
|
import io.netty.channel.ChannelFutureListener;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
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.channel.SimpleChannelInboundHandler;
|
||||||
import io.netty.util.concurrent.DefaultThreadFactory;
|
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
@ -33,24 +29,16 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
public abstract class TcpSession extends SimpleChannelInboundHandler<Packet> implements Session {
|
public abstract class TcpSession extends SimpleChannelInboundHandler<Packet> implements Session {
|
||||||
private static final Logger log = LoggerFactory.getLogger(TcpSession.class);
|
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 String host;
|
||||||
protected int port;
|
protected int port;
|
||||||
private final PacketProtocol protocol;
|
private final PacketProtocol protocol;
|
||||||
private final EventLoop eventLoop = createEventLoop();
|
private final Executor packetHandlerExecutor;
|
||||||
|
|
||||||
private final Map<String, Object> flags = new HashMap<>();
|
private final Map<String, Object> flags = new HashMap<>();
|
||||||
private final List<SessionListener> listeners = new CopyOnWriteArrayList<>();
|
private final List<SessionListener> listeners = new CopyOnWriteArrayList<>();
|
||||||
|
@ -58,10 +46,11 @@ public abstract class TcpSession extends SimpleChannelInboundHandler<Packet> imp
|
||||||
private Channel channel;
|
private Channel channel;
|
||||||
protected boolean disconnected = false;
|
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.host = host;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
this.protocol = protocol;
|
this.protocol = protocol;
|
||||||
|
this.packetHandlerExecutor = packetHandlerExecutor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -269,21 +258,6 @@ public abstract class TcpSession extends SimpleChannelInboundHandler<Packet> 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
|
@Override
|
||||||
public Channel getChannel() {
|
public Channel getChannel() {
|
||||||
return this.channel;
|
return this.channel;
|
||||||
|
@ -322,8 +296,8 @@ public abstract class TcpSession extends SimpleChannelInboundHandler<Packet> imp
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void channelRead0(ChannelHandlerContext ctx, Packet packet) {
|
protected void channelRead0(ChannelHandlerContext ctx, Packet packet) {
|
||||||
if (!packet.isPriority() && eventLoop != null) {
|
if (packet.shouldRunOnGameThread()) {
|
||||||
eventLoop.execute(() -> this.callPacketReceived(packet));
|
packetHandlerExecutor.execute(() -> this.callPacketReceived(packet));
|
||||||
} else {
|
} else {
|
||||||
this.callPacketReceived(packet);
|
this.callPacketReceived(packet);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.ServerboundHelloPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket;
|
import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundLoginAcknowledgedPacket;
|
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.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 org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundStatusRequestPacket;
|
||||||
|
|
||||||
import javax.crypto.KeyGenerator;
|
import javax.crypto.KeyGenerator;
|
||||||
|
|
|
@ -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.ServerboundHelloPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket;
|
import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundLoginAcknowledgedPacket;
|
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.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 org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundStatusRequestPacket;
|
||||||
|
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.geysermc.mcprotocollib.protocol.codec;
|
package org.geysermc.mcprotocollib.protocol.codec;
|
||||||
|
|
||||||
import org.geysermc.mcprotocollib.protocol.data.ProtocolState;
|
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.ClientboundCustomPayloadPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundCustomReportDetailsPacket;
|
import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundCustomReportDetailsPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundDisconnectPacket;
|
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.ClientboundStoreCookiePacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundTransferPacket;
|
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.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.ServerboundClientInformationPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundCustomPayloadPacket;
|
import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundCustomPayloadPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundKeepAlivePacket;
|
import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundKeepAlivePacket;
|
||||||
|
@ -207,9 +207,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.ServerboundHelloPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket;
|
import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundLoginAcknowledgedPacket;
|
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.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 org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundStatusRequestPacket;
|
||||||
|
|
||||||
public class MinecraftCodec {
|
public class MinecraftCodec {
|
||||||
|
|
|
@ -26,4 +26,10 @@ public class ClientboundCustomPayloadPacket implements MinecraftPacket {
|
||||||
helper.writeResourceLocation(out, this.channel);
|
helper.writeResourceLocation(out, this.channel);
|
||||||
out.writeBytes(this.data);
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,4 +33,9 @@ public class ClientboundCustomReportDetailsPacket implements MinecraftPacket {
|
||||||
helper.writeString(out, entry.getValue());
|
helper.writeString(out, entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,4 @@ public class ClientboundDisconnectPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeComponent(out, this.reason);
|
helper.writeComponent(out, this.reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isPriority() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,4 +21,9 @@ public class ClientboundPingPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
out.writeInt(this.id);
|
out.writeInt(this.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,4 +28,9 @@ public class ClientboundResourcePackPopPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeNullable(out, this.id, helper::writeUUID);
|
helper.writeNullable(out, this.id, helper::writeUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,4 +38,9 @@ public class ClientboundResourcePackPushPacket implements MinecraftPacket {
|
||||||
out.writeBoolean(this.required);
|
out.writeBoolean(this.required);
|
||||||
helper.writeNullable(out, this.prompt, helper::writeComponent);
|
helper.writeNullable(out, this.prompt, helper::writeComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,4 +52,9 @@ public class ClientboundServerLinksPacket implements MinecraftPacket {
|
||||||
helper.writeString(out, link.link());
|
helper.writeString(out, link.link());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,9 @@ public class ClientboundStoreCookiePacket implements MinecraftPacket {
|
||||||
helper.writeResourceLocation(out, this.key);
|
helper.writeResourceLocation(out, this.key);
|
||||||
helper.writeByteArray(out, this.payload);
|
helper.writeByteArray(out, this.payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,4 +24,10 @@ public class ClientboundTransferPacket implements MinecraftPacket {
|
||||||
helper.writeString(out, this.host);
|
helper.writeString(out, this.host);
|
||||||
helper.writeVarInt(out, this.port);
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,4 +53,9 @@ public class ClientboundUpdateTagsPacket implements MinecraftPacket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,10 @@ public class ServerboundClientInformationPacket implements MinecraftPacket {
|
||||||
out.writeBoolean(allowsListing);
|
out.writeBoolean(allowsListing);
|
||||||
helper.writeVarInt(out, this.particleStatus.ordinal());
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,9 @@ public class ServerboundResourcePackPacket implements MinecraftPacket {
|
||||||
helper.writeUUID(out, id);
|
helper.writeUUID(out, id);
|
||||||
helper.writeVarInt(out, this.status.ordinal());
|
helper.writeVarInt(out, this.status.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,11 @@ public class ClientboundFinishConfigurationPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTerminal() {
|
public boolean isTerminal() {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -31,4 +31,9 @@ public class ClientboundRegistryDataPacket implements MinecraftPacket {
|
||||||
helper.writeNullable(buf, entry.getData(), helper::writeAnyTag);
|
helper.writeNullable(buf, entry.getData(), helper::writeAnyTag);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,4 +28,9 @@ public class ClientboundSelectKnownPacks implements MinecraftPacket {
|
||||||
helper.writeString(buf, entry.getVersion());
|
helper.writeString(buf, entry.getVersion());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,11 @@ public class ServerboundFinishConfigurationPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf buf, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf buf, MinecraftCodecHelper helper) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTerminal() {
|
public boolean isTerminal() {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -39,4 +39,9 @@ public class ServerboundSelectKnownPacks implements MinecraftPacket {
|
||||||
helper.writeString(out, entry.getVersion());
|
helper.writeString(out, entry.getVersion());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 io.netty.buffer.ByteBuf;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -22,4 +22,9 @@ public class ClientboundCookieRequestPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeResourceLocation(out, this.key);
|
helper.writeResourceLocation(out, this.key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -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 io.netty.buffer.ByteBuf;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
|
@ -33,11 +33,6 @@ public class ClientIntentionPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.intent.ordinal() + 1);
|
helper.writeVarInt(out, this.intent.ordinal() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isPriority() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTerminal() {
|
public boolean isTerminal() {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -91,4 +91,9 @@ public class ClientboundAwardStatsPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, entry.getIntValue());
|
helper.writeVarInt(out, entry.getIntValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,4 +138,9 @@ public class ClientboundBossEventPacket implements MinecraftPacket {
|
||||||
out.writeByte(flags);
|
out.writeByte(flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,4 +16,9 @@ public class ClientboundBundlePacket implements MinecraftPacket {
|
||||||
@Override
|
@Override
|
||||||
public void serialize(ByteBuf buf, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf buf, MinecraftCodecHelper helper) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,9 @@ public class ClientboundChangeDifficultyPacket implements MinecraftPacket {
|
||||||
out.writeByte(this.difficulty.ordinal());
|
out.writeByte(this.difficulty.ordinal());
|
||||||
out.writeBoolean(this.difficultyLocked);
|
out.writeBoolean(this.difficultyLocked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,4 +62,9 @@ public class ClientboundCommandSuggestionsPacket implements MinecraftPacket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,4 +300,9 @@ public class ClientboundCommandsPacket implements MinecraftPacket {
|
||||||
|
|
||||||
helper.writeVarInt(out, this.firstNodeIndex);
|
helper.writeVarInt(out, this.firstNodeIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,9 @@ public class ClientboundCooldownPacket implements MinecraftPacket {
|
||||||
helper.writeResourceLocation(out, this.cooldownGroup);
|
helper.writeResourceLocation(out, this.cooldownGroup);
|
||||||
helper.writeVarInt(out, this.cooldownTicks);
|
helper.writeVarInt(out, this.cooldownTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,4 +31,9 @@ public class ClientboundCustomChatCompletionsPacket implements MinecraftPacket {
|
||||||
helper.writeString(out, entry);
|
helper.writeString(out, entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,9 @@ public class ClientboundDeleteChatPacket implements MinecraftPacket {
|
||||||
out.writeBytes(messageSignature.getMessageSignature());
|
out.writeBytes(messageSignature.getMessageSignature());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,4 +11,9 @@ public class ClientboundDelimiterPacket implements MinecraftPacket {
|
||||||
@Override
|
@Override
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,4 +35,9 @@ public class ClientboundDisguisedChatPacket implements MinecraftPacket {
|
||||||
helper.writeComponent(out, this.name);
|
helper.writeComponent(out, this.name);
|
||||||
helper.writeNullable(out, this.targetName, helper::writeComponent);
|
helper.writeNullable(out, this.targetName, helper::writeComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,4 +61,9 @@ public class ClientboundLoginPacket implements MinecraftPacket {
|
||||||
helper.writePlayerSpawnInfo(out, this.commonPlayerSpawnInfo);
|
helper.writePlayerSpawnInfo(out, this.commonPlayerSpawnInfo);
|
||||||
out.writeBoolean(this.enforcesSecureChat);
|
out.writeBoolean(this.enforcesSecureChat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,4 +84,9 @@ public class ClientboundPlayerChatPacket implements MinecraftPacket {
|
||||||
helper.writeComponent(out, this.name);
|
helper.writeComponent(out, this.name);
|
||||||
helper.writeNullable(out, this.targetName, helper::writeComponent);
|
helper.writeNullable(out, this.targetName, helper::writeComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,9 @@ public class ClientboundPlayerInfoRemovePacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeList(out, this.profileIds, helper::writeUUID);
|
helper.writeList(out, this.profileIds, helper::writeUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,4 +121,9 @@ public class ClientboundPlayerInfoUpdatePacket implements MinecraftPacket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,11 @@ public class ClientboundRecipeBookAddPacket implements MinecraftPacket {
|
||||||
out.writeBoolean(this.replace);
|
out.writeBoolean(this.replace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public record Entry(RecipeDisplayEntry contents, boolean notification, boolean highlight) {
|
public record Entry(RecipeDisplayEntry contents, boolean notification, boolean highlight) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,9 @@ public class ClientboundRecipeBookRemovePacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, recipe);
|
helper.writeVarInt(out, recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,11 @@ public class ClientboundRecipeBookSettingsPacket implements MinecraftPacket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private record TypeSettings(boolean open, boolean filtering) {
|
private record TypeSettings(boolean open, boolean filtering) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,9 @@ public class ClientboundRespawnPacket implements MinecraftPacket {
|
||||||
}
|
}
|
||||||
out.writeByte(dataToKeep);
|
out.writeByte(dataToKeep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,9 @@ public class ClientboundSelectAdvancementsTabPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeNullable(out, this.tabId, helper::writeString);
|
helper.writeNullable(out, this.tabId, helper::writeString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,9 @@ public class ClientboundServerDataPacket implements MinecraftPacket {
|
||||||
helper.writeComponent(out, this.motd);
|
helper.writeComponent(out, this.motd);
|
||||||
helper.writeNullable(out, this.iconBytes, helper::writeByteArray);
|
helper.writeNullable(out, this.iconBytes, helper::writeByteArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,4 +21,9 @@ public class ClientboundSetCameraPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeVarInt(out, this.cameraEntityId);
|
helper.writeVarInt(out, this.cameraEntityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,4 +46,9 @@ public class ClientboundSoundEntityPacket implements MinecraftPacket {
|
||||||
out.writeFloat(this.pitch);
|
out.writeFloat(this.pitch);
|
||||||
out.writeLong(this.seed);
|
out.writeLong(this.seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,11 @@ public class ClientboundStartConfigurationPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTerminal() {
|
public boolean isTerminal() {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -55,4 +55,9 @@ public class ClientboundStopSoundPacket implements MinecraftPacket {
|
||||||
helper.writeResourceLocation(out, this.sound);
|
helper.writeResourceLocation(out, this.sound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,9 @@ public class ClientboundSystemChatPacket implements MinecraftPacket {
|
||||||
helper.writeComponent(out, this.content);
|
helper.writeComponent(out, this.content);
|
||||||
out.writeBoolean(this.overlay);
|
out.writeBoolean(this.overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,9 @@ public class ClientboundTabListPacket implements MinecraftPacket {
|
||||||
helper.writeComponent(out, this.header);
|
helper.writeComponent(out, this.header);
|
||||||
helper.writeComponent(out, this.footer);
|
helper.writeComponent(out, this.footer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,9 @@ public class ClientboundTickingStatePacket implements MinecraftPacket {
|
||||||
out.writeFloat(tickRate);
|
out.writeFloat(tickRate);
|
||||||
out.writeBoolean(isFrozen);
|
out.writeBoolean(isFrozen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,9 @@ public class ClientboundTickingStepPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeVarInt(out, this.tickSteps);
|
helper.writeVarInt(out, this.tickSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,4 +166,9 @@ public class ClientboundUpdateAdvancementsPacket implements MinecraftPacket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,4 +60,9 @@ public class ClientboundUpdateRecipesPacket implements MinecraftPacket {
|
||||||
|
|
||||||
public record SelectableRecipe(Ingredient input, SlotDisplay recipe) {
|
public record SelectableRecipe(Ingredient input, SlotDisplay recipe) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,4 +30,9 @@ public class ClientboundAnimatePacket implements MinecraftPacket {
|
||||||
out.writeByte(this.animation.getId());
|
out.writeByte(this.animation.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,4 +41,9 @@ public class ClientboundDamageEventPacket implements MinecraftPacket {
|
||||||
out.writeBoolean(false);
|
out.writeBoolean(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,9 @@ public class ClientboundEntityEventPacket implements MinecraftPacket {
|
||||||
out.writeInt(this.entityId);
|
out.writeInt(this.entityId);
|
||||||
helper.writeEntityEvent(out, this.event);
|
helper.writeEntityEvent(out, this.event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,4 +41,9 @@ public class ClientboundEntityPositionSyncPacket implements MinecraftPacket {
|
||||||
out.writeFloat(this.xRot);
|
out.writeFloat(this.xRot);
|
||||||
out.writeBoolean(this.onGround);
|
out.writeBoolean(this.onGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,4 +24,9 @@ public class ClientboundHurtAnimationPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.id);
|
helper.writeVarInt(out, this.id);
|
||||||
out.writeFloat(this.yaw);
|
out.writeFloat(this.yaw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,4 +33,9 @@ public class ClientboundMoveEntityPosPacket implements MinecraftPacket {
|
||||||
out.writeShort((int) (this.moveZ * 4096));
|
out.writeShort((int) (this.moveZ * 4096));
|
||||||
out.writeBoolean(this.onGround);
|
out.writeBoolean(this.onGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,9 @@ public class ClientboundMoveEntityPosRotPacket implements MinecraftPacket {
|
||||||
out.writeByte((byte) (this.pitch * 256 / 360));
|
out.writeByte((byte) (this.pitch * 256 / 360));
|
||||||
out.writeBoolean(this.onGround);
|
out.writeBoolean(this.onGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,4 +30,9 @@ public class ClientboundMoveEntityRotPacket implements MinecraftPacket {
|
||||||
out.writeByte((byte) (this.pitch * 256 / 360));
|
out.writeByte((byte) (this.pitch * 256 / 360));
|
||||||
out.writeBoolean(this.onGround);
|
out.writeBoolean(this.onGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,4 +50,9 @@ public class ClientboundMoveMinecartPacket implements MinecraftPacket {
|
||||||
output.writeFloat(lerpStep.weight());
|
output.writeFloat(lerpStep.weight());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,4 +33,9 @@ public class ClientboundMoveVehiclePacket implements MinecraftPacket {
|
||||||
out.writeFloat(this.yaw);
|
out.writeFloat(this.yaw);
|
||||||
out.writeFloat(this.pitch);
|
out.writeFloat(this.pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,4 +24,9 @@ public class ClientboundProjectilePowerPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.id);
|
helper.writeVarInt(out, this.id);
|
||||||
out.writeDouble(this.accelerationPower);
|
out.writeDouble(this.accelerationPower);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,4 +28,9 @@ public class ClientboundRemoveEntitiesPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, entityId);
|
helper.writeVarInt(out, entityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,9 @@ public class ClientboundRemoveMobEffectPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.entityId);
|
helper.writeVarInt(out, this.entityId);
|
||||||
helper.writeEffect(out, this.effect);
|
helper.writeEffect(out, this.effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,4 +24,9 @@ public class ClientboundRotateHeadPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.entityId);
|
helper.writeVarInt(out, this.entityId);
|
||||||
out.writeByte((byte) (this.headYaw * 256 / 360));
|
out.writeByte((byte) (this.headYaw * 256 / 360));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,9 @@ public class ClientboundSetEntityDataPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.entityId);
|
helper.writeVarInt(out, this.entityId);
|
||||||
helper.writeEntityMetadata(out, this.metadata);
|
helper.writeEntityMetadata(out, this.metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,4 +24,9 @@ public class ClientboundSetEntityLinkPacket implements MinecraftPacket {
|
||||||
out.writeInt(this.entityId);
|
out.writeInt(this.entityId);
|
||||||
out.writeInt(this.attachedToId);
|
out.writeInt(this.attachedToId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,4 +30,9 @@ public class ClientboundSetEntityMotionPacket implements MinecraftPacket {
|
||||||
out.writeShort((int) (this.motionY * 8000));
|
out.writeShort((int) (this.motionY * 8000));
|
||||||
out.writeShort((int) (this.motionZ * 8000));
|
out.writeShort((int) (this.motionZ * 8000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,4 +47,9 @@ public class ClientboundSetEquipmentPacket implements MinecraftPacket {
|
||||||
helper.writeOptionalItemStack(out, this.equipment[i].getItem());
|
helper.writeOptionalItemStack(out, this.equipment[i].getItem());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,4 +31,9 @@ public class ClientboundSetPassengersPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, entityId);
|
helper.writeVarInt(out, entityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,4 +27,9 @@ public class ClientboundTakeItemEntityPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.collectorEntityId);
|
helper.writeVarInt(out, this.collectorEntityId);
|
||||||
helper.writeVarInt(out, this.itemCount);
|
helper.writeVarInt(out, this.itemCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,4 +64,9 @@ public class ClientboundTeleportEntityPacket implements MinecraftPacket {
|
||||||
|
|
||||||
out.writeBoolean(this.onGround);
|
out.writeBoolean(this.onGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,4 +54,9 @@ public class ClientboundUpdateAttributesPacket implements MinecraftPacket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,4 +63,9 @@ public class ClientboundUpdateMobEffectPacket implements MinecraftPacket {
|
||||||
|
|
||||||
out.writeByte(flags);
|
out.writeByte(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,4 +21,9 @@ public class ClientboundBlockChangedAckPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeVarInt(out, this.sequence);
|
helper.writeVarInt(out, this.sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,4 +58,9 @@ public class ClientboundPlayerAbilitiesPacket implements MinecraftPacket {
|
||||||
out.writeFloat(this.flySpeed);
|
out.writeFloat(this.flySpeed);
|
||||||
out.writeFloat(this.walkSpeed);
|
out.writeFloat(this.walkSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,9 @@ public class ClientboundPlayerCombatKillPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.playerId);
|
helper.writeVarInt(out, this.playerId);
|
||||||
helper.writeComponent(out, this.message);
|
helper.writeComponent(out, this.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,4 +55,9 @@ public class ClientboundPlayerLookAtPacket implements MinecraftPacket {
|
||||||
out.writeBoolean(false);
|
out.writeBoolean(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,4 +66,9 @@ public class ClientboundPlayerPositionPacket implements MinecraftPacket {
|
||||||
|
|
||||||
out.writeInt(flags);
|
out.writeInt(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,4 +24,9 @@ public class ClientboundPlayerRotationPacket implements MinecraftPacket {
|
||||||
out.writeFloat(this.yRot);
|
out.writeFloat(this.yRot);
|
||||||
out.writeFloat(this.xRot);
|
out.writeFloat(this.xRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,4 +27,9 @@ public class ClientboundSetExperiencePacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.level);
|
helper.writeVarInt(out, this.level);
|
||||||
helper.writeVarInt(out, this.totalExperience);
|
helper.writeVarInt(out, this.totalExperience);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,4 +27,9 @@ public class ClientboundSetHealthPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.food);
|
helper.writeVarInt(out, this.food);
|
||||||
out.writeFloat(this.saturation);
|
out.writeFloat(this.saturation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,4 +21,9 @@ public class ClientboundSetHeldSlotPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
out.writeByte(this.slot);
|
out.writeByte(this.slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,4 +120,9 @@ public class ClientboundAddEntityPacket implements MinecraftPacket {
|
||||||
out.writeShort((int) (this.motionY * 8000));
|
out.writeShort((int) (this.motionY * 8000));
|
||||||
out.writeShort((int) (this.motionZ * 8000));
|
out.writeShort((int) (this.motionZ * 8000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,4 +33,9 @@ public class ClientboundAddExperienceOrbPacket implements MinecraftPacket {
|
||||||
out.writeDouble(this.z);
|
out.writeDouble(this.z);
|
||||||
out.writeShort(this.exp);
|
out.writeShort(this.exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,4 +21,9 @@ public class ClientboundContainerClosePacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeVarInt(out, this.containerId);
|
helper.writeVarInt(out, this.containerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,9 @@ public class ClientboundContainerSetContentPacket implements MinecraftPacket {
|
||||||
}
|
}
|
||||||
helper.writeOptionalItemStack(out, this.carriedItem);
|
helper.writeOptionalItemStack(out, this.carriedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,4 +32,9 @@ public class ClientboundContainerSetDataPacket implements MinecraftPacket {
|
||||||
out.writeShort(this.rawProperty);
|
out.writeShort(this.rawProperty);
|
||||||
out.writeShort(this.value);
|
out.writeShort(this.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,4 +32,9 @@ public class ClientboundContainerSetSlotPacket implements MinecraftPacket {
|
||||||
out.writeShort(this.slot);
|
out.writeShort(this.slot);
|
||||||
helper.writeOptionalItemStack(out, this.item);
|
helper.writeOptionalItemStack(out, this.item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,4 +27,9 @@ public class ClientboundHorseScreenOpenPacket implements MinecraftPacket {
|
||||||
helper.writeVarInt(out, this.inventoryColumns);
|
helper.writeVarInt(out, this.inventoryColumns);
|
||||||
out.writeInt(this.entityId);
|
out.writeInt(this.entityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,9 @@ public class ClientboundMerchantOffersPacket implements MinecraftPacket {
|
||||||
out.writeBoolean(this.regularVillager);
|
out.writeBoolean(this.regularVillager);
|
||||||
out.writeBoolean(this.canRestock);
|
out.writeBoolean(this.canRestock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,9 @@ public class ClientboundOpenBookPacket implements MinecraftPacket {
|
||||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
|
||||||
helper.writeVarInt(out, this.hand.ordinal());
|
helper.writeVarInt(out, this.hand.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRunOnGameThread() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue