From bbe41efdb62f8ed944d3eac0e126e445f2d7ea3e Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:48:50 +0200 Subject: [PATCH 1/3] Move packets to proper packages & implement game thread metadata for every packet --- .../mcprotocollib/network/packet/Packet.java | 11 +++--- .../tcp/DefaultPacketHandlerExecutor.java | 34 +++++++++++++++++ .../network/tcp/TcpClientSession.java | 2 +- .../network/tcp/TcpServerSession.java | 2 +- .../mcprotocollib/network/tcp/TcpSession.java | 38 +++---------------- .../protocol/ClientListener.java | 4 +- .../protocol/ServerListener.java | 4 +- .../protocol/codec/MinecraftCodec.java | 8 ++-- .../ClientboundCustomPayloadPacket.java | 6 +++ .../ClientboundCustomReportDetailsPacket.java | 5 +++ .../ClientboundDisconnectPacket.java | 5 --- .../clientbound/ClientboundPingPacket.java | 5 +++ .../ClientboundResourcePackPopPacket.java | 5 +++ .../ClientboundResourcePackPushPacket.java | 5 +++ .../ClientboundServerLinksPacket.java | 5 +++ .../ClientboundStoreCookiePacket.java | 5 +++ .../ClientboundTransferPacket.java | 6 +++ .../ClientboundUpdateTagsPacket.java | 5 +++ .../ServerboundClientInformationPacket.java | 6 +++ .../ServerboundResourcePackPacket.java | 5 +++ .../ClientboundFinishConfigurationPacket.java | 5 +++ .../ClientboundRegistryDataPacket.java | 5 +++ .../ClientboundSelectKnownPacks.java | 5 +++ .../ServerboundFinishConfigurationPacket.java | 5 +++ .../ServerboundSelectKnownPacks.java | 5 +++ .../ClientboundCookieRequestPacket.java | 7 +++- .../ServerboundCookieResponsePacket.java | 2 +- .../serverbound/ClientIntentionPacket.java | 5 --- .../ClientboundAwardStatsPacket.java | 5 +++ .../ClientboundBossEventPacket.java | 5 +++ .../clientbound/ClientboundBundlePacket.java | 5 +++ .../ClientboundChangeDifficultyPacket.java | 5 +++ .../ClientboundCommandSuggestionsPacket.java | 5 +++ .../ClientboundCommandsPacket.java | 5 +++ .../ClientboundCooldownPacket.java | 5 +++ ...lientboundCustomChatCompletionsPacket.java | 5 +++ .../ClientboundDeleteChatPacket.java | 5 +++ .../ClientboundDelimiterPacket.java | 5 +++ .../ClientboundDisguisedChatPacket.java | 5 +++ .../clientbound/ClientboundLoginPacket.java | 5 +++ .../ClientboundPlayerChatPacket.java | 5 +++ .../ClientboundPlayerInfoRemovePacket.java | 5 +++ .../ClientboundPlayerInfoUpdatePacket.java | 5 +++ .../clientbound/ClientboundRecipePacket.java | 5 +++ .../clientbound/ClientboundRespawnPacket.java | 5 +++ ...lientboundSelectAdvancementsTabPacket.java | 5 +++ .../ClientboundServerDataPacket.java | 5 +++ .../ClientboundSetCameraPacket.java | 5 +++ .../ClientboundSoundEntityPacket.java | 5 +++ .../ClientboundStartConfigurationPacket.java | 5 +++ .../ClientboundStopSoundPacket.java | 5 +++ .../ClientboundSystemChatPacket.java | 5 +++ .../clientbound/ClientboundTabListPacket.java | 5 +++ .../ClientboundTickingStatePacket.java | 5 +++ .../ClientboundTickingStepPacket.java | 5 +++ .../ClientboundUpdateAdvancementsPacket.java | 5 +++ .../ClientboundUpdateRecipesPacket.java | 5 +++ .../entity/ClientboundAnimatePacket.java | 5 +++ .../entity/ClientboundDamageEventPacket.java | 5 +++ .../entity/ClientboundEntityEventPacket.java | 5 +++ .../ClientboundHurtAnimationPacket.java | 5 +++ .../ClientboundMoveEntityPosPacket.java | 5 +++ .../ClientboundMoveEntityPosRotPacket.java | 5 +++ .../ClientboundMoveEntityRotPacket.java | 5 +++ .../entity/ClientboundMoveVehiclePacket.java | 5 +++ .../ClientboundProjectilePowerPacket.java | 5 +++ .../ClientboundRemoveEntitiesPacket.java | 5 +++ .../ClientboundRemoveMobEffectPacket.java | 5 +++ .../entity/ClientboundRotateHeadPacket.java | 5 +++ .../ClientboundSetEntityDataPacket.java | 5 +++ .../ClientboundSetEntityLinkPacket.java | 5 +++ .../ClientboundSetEntityMotionPacket.java | 5 +++ .../entity/ClientboundSetEquipmentPacket.java | 5 +++ .../ClientboundSetPassengersPacket.java | 5 +++ .../ClientboundTakeItemEntityPacket.java | 5 +++ .../ClientboundTeleportEntityPacket.java | 5 +++ .../ClientboundUpdateAttributesPacket.java | 5 +++ .../ClientboundUpdateMobEffectPacket.java | 5 +++ .../ClientboundBlockChangedAckPacket.java | 5 +++ .../ClientboundPlayerAbilitiesPacket.java | 5 +++ .../ClientboundPlayerCombatKillPacket.java | 5 +++ .../player/ClientboundPlayerLookAtPacket.java | 5 +++ .../ClientboundPlayerPositionPacket.java | 5 +++ .../ClientboundSetCarriedItemPacket.java | 5 +++ .../ClientboundSetExperiencePacket.java | 5 +++ .../player/ClientboundSetHealthPacket.java | 5 +++ .../spawn/ClientboundAddEntityPacket.java | 5 +++ .../ClientboundAddExperienceOrbPacket.java | 5 +++ .../ClientboundContainerClosePacket.java | 5 +++ .../ClientboundContainerSetContentPacket.java | 5 +++ .../ClientboundContainerSetDataPacket.java | 5 +++ .../ClientboundContainerSetSlotPacket.java | 5 +++ .../ClientboundHorseScreenOpenPacket.java | 5 +++ .../ClientboundMerchantOffersPacket.java | 5 +++ .../inventory/ClientboundOpenBookPacket.java | 5 +++ .../ClientboundOpenScreenPacket.java | 5 +++ .../ClientboundPlaceGhostRecipePacket.java | 5 +++ .../ClientboundBlockDestructionPacket.java | 5 +++ .../ClientboundBlockEntityDataPacket.java | 5 +++ .../level/ClientboundBlockEventPacket.java | 5 +++ .../level/ClientboundBlockUpdatePacket.java | 5 +++ .../level/ClientboundChunksBiomesPacket.java | 5 +++ .../level/ClientboundExplodePacket.java | 5 +++ .../ClientboundForgetLevelChunkPacket.java | 5 +++ .../level/ClientboundGameEventPacket.java | 5 +++ .../ClientboundLevelChunkWithLightPacket.java | 5 +++ .../level/ClientboundLevelEventPacket.java | 5 +++ .../ClientboundLevelParticlesPacket.java | 5 +++ .../level/ClientboundLightUpdatePacket.java | 5 +++ .../level/ClientboundMapItemDataPacket.java | 5 +++ .../ClientboundOpenSignEditorPacket.java | 5 +++ .../ClientboundSectionBlocksUpdatePacket.java | 5 +++ .../ClientboundSetChunkCacheCenterPacket.java | 5 +++ .../ClientboundSetChunkCacheRadiusPacket.java | 5 +++ ...entboundSetDefaultSpawnPositionPacket.java | 5 +++ ...lientboundSetSimulationDistancePacket.java | 5 +++ .../level/ClientboundSetTimePacket.java | 5 +++ .../level/ClientboundSoundPacket.java | 5 +++ .../level/ClientboundTagQueryPacket.java | 5 +++ .../ClientboundInitializeBorderPacket.java | 5 +++ .../ClientboundSetBorderCenterPacket.java | 5 +++ .../ClientboundSetBorderLerpSizePacket.java | 5 +++ .../ClientboundSetBorderSizePacket.java | 5 +++ ...lientboundSetBorderWarningDelayPacket.java | 5 +++ ...ntboundSetBorderWarningDistancePacket.java | 5 +++ .../ClientboundResetScorePacket.java | 5 +++ .../ClientboundSetDisplayObjectivePacket.java | 5 +++ .../ClientboundSetObjectivePacket.java | 5 +++ .../ClientboundSetPlayerTeamPacket.java | 5 +++ .../scoreboard/ClientboundSetScorePacket.java | 5 +++ .../title/ClientboundClearTitlesPacket.java | 5 +++ .../ClientboundSetActionBarTextPacket.java | 5 +++ .../ClientboundSetSubtitleTextPacket.java | 5 +++ .../title/ClientboundSetTitleTextPacket.java | 5 +++ .../ClientboundSetTitlesAnimationPacket.java | 5 +++ .../ServerboundChangeDifficultyPacket.java | 5 +++ .../ServerboundChatSessionUpdatePacket.java | 5 +++ .../ServerboundClientCommandPacket.java | 5 +++ .../ServerboundCommandSuggestionPacket.java | 5 +++ ...verboundDebugSampleSubscriptionPacket.java | 5 +++ .../ServerboundLockDifficultyPacket.java | 5 +++ ...ServerboundContainerButtonClickPacket.java | 5 +++ .../ServerboundContainerClickPacket.java | 5 +++ .../ServerboundContainerClosePacket.java | 5 +++ ...rboundContainerSlotStateChangedPacket.java | 5 +++ .../inventory/ServerboundPickItemPacket.java | 5 +++ .../ServerboundPlaceRecipePacket.java | 5 +++ ...erboundRecipeBookChangeSettingsPacket.java | 5 +++ ...ServerboundRecipeBookSeenRecipePacket.java | 5 +++ .../ServerboundRenameItemPacket.java | 5 +++ .../ServerboundSeenAdvancementsPacket.java | 5 +++ .../ServerboundSelectTradePacket.java | 5 +++ .../inventory/ServerboundSetBeaconPacket.java | 5 +++ .../ServerboundSetCommandBlockPacket.java | 5 +++ .../ServerboundSetCommandMinecartPacket.java | 5 +++ .../ServerboundSetCreativeModeSlotPacket.java | 5 +++ .../ServerboundSetJigsawBlockPacket.java | 5 +++ .../ServerboundSetStructureBlockPacket.java | 5 +++ .../ServerboundAcceptTeleportationPacket.java | 5 +++ .../ServerboundBlockEntityTagQueryPacket.java | 5 +++ .../ServerboundChunkBatchReceivedPacket.java | 5 +++ .../level/ServerboundEntityTagQuery.java | 5 +++ .../ServerboundJigsawGeneratePacket.java | 5 +++ .../level/ServerboundMoveVehiclePacket.java | 5 +++ .../level/ServerboundPaddleBoatPacket.java | 5 +++ .../level/ServerboundPlayerInputPacket.java | 5 +++ .../ServerboundTeleportToEntityPacket.java | 5 +++ .../player/ServerboundInteractPacket.java | 5 +++ .../ServerboundMovePlayerPosPacket.java | 5 +++ .../ServerboundMovePlayerPosRotPacket.java | 5 +++ .../ServerboundMovePlayerRotPacket.java | 5 +++ ...ServerboundMovePlayerStatusOnlyPacket.java | 5 +++ .../ServerboundPlayerAbilitiesPacket.java | 5 +++ .../player/ServerboundPlayerActionPacket.java | 5 +++ .../ServerboundPlayerCommandPacket.java | 5 +++ .../ServerboundSetCarriedItemPacket.java | 5 +++ .../player/ServerboundSwingPacket.java | 5 +++ .../player/ServerboundUseItemOnPacket.java | 5 +++ .../player/ServerboundUseItemPacket.java | 5 +++ .../ClientboundGameProfilePacket.java | 5 --- .../clientbound/ClientboundHelloPacket.java | 5 --- .../ClientboundLoginCompressionPacket.java | 5 --- .../ClientboundLoginDisconnectPacket.java | 5 --- .../serverbound/ServerboundHelloPacket.java | 5 --- .../serverbound/ServerboundKeyPacket.java | 5 --- .../ClientboundPongResponsePacket.java | 2 +- .../ServerboundPingRequestPacket.java | 2 +- .../ClientboundPongResponsePacketTest.java | 1 + .../ServerboundPingRequestPacketTest.java | 1 + 189 files changed, 905 insertions(+), 91 deletions(-) create mode 100644 protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/DefaultPacketHandlerExecutor.java rename protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/{common => cookie}/clientbound/ClientboundCookieRequestPacket.java (82%) rename protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/{common/clientbound => cookie/serverbound}/ServerboundCookieResponsePacket.java (93%) rename protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/{status => ping}/clientbound/ClientboundPongResponsePacket.java (90%) rename protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/{status => ping}/serverbound/ServerboundPingRequestPacket.java (90%) 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 94d68197f..b358378ea 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 @@ 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 000000000..e9cb75b41 --- /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 4c3ac62ff..53364cb32 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 @@ -76,7 +76,7 @@ public TcpClientSession(String host, int port, String bindAddress, int bindPort, } public TcpClientSession(String host, int port, String bindAddress, int bindPort, PacketProtocol protocol, ProxyInfo proxy) { - super(host, port, protocol); + super(host, port, protocol, DefaultPacketHandlerExecutor.createExecutor()); this.bindAddress = bindAddress; this.bindPort = bindPort; this.proxy = proxy; 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 f84779302..27b64c11e 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 @@ -13,7 +13,7 @@ public class TcpServerSession extends TcpSession { private final PacketCodecHelper codecHelper; public TcpServerSession(String host, int port, PacketProtocol protocol, TcpServer server) { - super(host, port, protocol); + super(host, port, protocol, DefaultPacketHandlerExecutor.createExecutor()); 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 f17fa910a..7af102dd1 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 @@ 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.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 void setAutoRead(boolean autoRead) { } } - 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 void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { @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 ad017f614..780b00ce8 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.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 5de069283..9a59410be 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.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 f3ccc98af..1b17aab5d 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.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; @@ -198,9 +198,9 @@ 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 fcd917eec..8f7eca9e9 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 17d144c3e..891e9317b 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 cf9b05a19..927dacc25 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 ClientboundDisconnectPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 b11c4bfd6..b09f29a57 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 ClientboundPingPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 5d63071b5..4f8d40190 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 ClientboundResourcePackPopPacket(ByteBuf in, MinecraftCodecHelper helper) 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 4aec3c92f..edc123a8f 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 e6a28a10e..6cd53982d 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 a7a9753cd..22eec45ff 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 2bc8d1091..72fbc2d77 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 0bfff1fe2..b09104f2e 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { } } } + + @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 51e82c1fa..40922f9e1 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 @@ -68,4 +68,10 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeBoolean(this.textFilteringEnabled); out.writeBoolean(allowsListing); } + + @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 1bdcef7ff..c2944d933 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 f248a38c3..69549f6d6 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 ClientboundFinishConfigurationPacket(ByteBuf in, MinecraftCodecHelper hel 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 9512ef4a3..6f5fd3d9f 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 e5dfa96f4..c7e2c748d 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 75147f6c1..d3d68b2a7 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 ServerboundFinishConfigurationPacket(ByteBuf in, MinecraftCodecHelper hel 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 d8cfd6d7f..12f67f5ce 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 df2ed4233..29c77cacb 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 ClientboundCookieRequestPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 66afbff02..6f831cb49 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 d1799dbc2..b1d01b5e5 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 3c281514e..d2fdaf899 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 3e4aef6da..fb3acf91f 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 8bf5c7a84..8da8f1737 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 e0d6af7b9..c2370a707 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 ccf5b8aef..9fd73fb4b 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 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/clientbound/ClientboundCommandsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandsPacket.java index 9187c49a1..d9954acd7 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 ea49bacf3..26140724b 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 @@ -24,4 +24,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.itemId); 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 4192925fe..a612d097d 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 66a5ee4cf..62f6f9033 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeBytes(messageSignature.getMessageSignature()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDelimiterPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDelimiterPacket.java index f99402be6..57f9feed2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDelimiterPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDelimiterPacket.java @@ -11,4 +11,9 @@ public ClientboundDelimiterPacket(ByteBuf in, MinecraftCodecHelper helper) { @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/clientbound/ClientboundDisguisedChatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDisguisedChatPacket.java index 15d236e9b..01de2bee1 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 8465b9045..f2c0d3856 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 746f0792d..672369f9c 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 041534e72..09807c08c 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 ClientboundPlayerInfoRemovePacket(ByteBuf in, MinecraftCodecHelper helper 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 07a0b638f..b2157412b 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 @@ -115,4 +115,9 @@ 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/clientbound/ClientboundRecipePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipePacket.java index 844f1b18d..963099ea9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipePacket.java @@ -126,4 +126,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeString(out, recipeId); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } 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 555ea1765..4a1cc0fb1 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { } 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 a38e24bdc..ccb551bb0 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 ClientboundSelectAdvancementsTabPacket(ByteBuf in, MinecraftCodecHelper h 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 34f139e12..c1f8f7da9 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 0cb0232eb..6c5d6d3be 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 ClientboundSetCameraPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 ec9859583..d227d5b8d 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d7844e6e3..5510c57e1 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 ClientboundStartConfigurationPacket(ByteBuf in, MinecraftCodecHelper help 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 cc20b54be..1d4c45c83 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 682a9de42..9b7999304 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 b80fdea45..fc1956ada 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 fa468096b..8f928d5ef 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 0898a134e..4e53f5c4f 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 ClientboundTickingStepPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 8293a17cb..ed9005808 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 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/clientbound/ClientboundUpdateRecipesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateRecipesPacket.java index 7c72d58b6..b7b558676 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 @@ -185,4 +185,9 @@ 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/clientbound/entity/ClientboundAnimatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundAnimatePacket.java index 6dca267ac..80e080337 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 a94a1239d..aef01afc6 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 84a2d07b7..c3b363df3 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/ClientboundHurtAnimationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundHurtAnimationPacket.java index d7a6b0320..bb30ea711 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 5afa47e28..d7a2a21f8 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 ba5611365..f690ec626 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 6099fc771..4599f9d4d 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/ClientboundMoveVehiclePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveVehiclePacket.java index 989860d04..e45196ef8 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 @@ -33,4 +33,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeFloat(this.yaw); out.writeFloat(this.pitch); } + + @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 81f41311b..4093f786d 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 96dc1b0ec..44aba673e 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 81ac0968b..b6fc0da1a 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 3b769fd5a..ab5197c0b 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 22081f451..bf0c80383 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d91fd9e1d..b1da4dba5 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 fe2c9617f..58ff798cf 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 95eb9c6b6..1cc09702e 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 2a479e7bd..0bdee16e9 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 5e28f50e4..b9f4e2279 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 565b84d35..cce01b872 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 @@ -39,4 +39,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/ClientboundUpdateAttributesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateAttributesPacket.java index 4fe3b57f5..e20ea7e96 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 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/clientbound/entity/ClientboundUpdateMobEffectPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateMobEffectPacket.java index 985c2dfeb..478e048c3 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 9b1e18804..cf916aba0 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 ClientboundBlockChangedAckPacket(ByteBuf in, MinecraftCodecHelper helper) 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 f18dfa58c..071e728cc 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 7dd834931..f4c94d38a 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 c9862d034..a8f60bbb3 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 f5465a7f8..389f987c2 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 @@ -65,4 +65,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.teleportId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetCarriedItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetCarriedItemPacket.java index 9ebe13aa9..d390c4693 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetCarriedItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetCarriedItemPacket.java @@ -21,4 +21,9 @@ public ClientboundSetCarriedItemPacket(ByteBuf in, MinecraftCodecHelper helper) public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeByte(this.slot); } + + @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 ae1e90045..ff68090cb 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 e6747eaa9..43c99a874 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/spawn/ClientboundAddEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddEntityPacket.java index 14213e0ec..f6aa245ea 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d5531bbbf..ece0a369f 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 191773df4..d8fe55b5a 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 ClientboundContainerClosePacket(ByteBuf in, MinecraftCodecHelper helper) public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeByte(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 bcfc7609c..4955e0a20 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { } 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 36f900fd5..8839afed0 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 66b99058a..687009066 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 32371832f..d921f3b58 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 aef6a66d1..cf33181c2 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 55f5f2fe2..efeced26d 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 ClientboundOpenBookPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 193133889..22eaa4de2 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 String getName() { 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 352e5511f..c4ef0173b 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 @@ -25,4 +25,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeByte(this.containerId); helper.writeString(out, this.recipeId); } + + @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 76c0955b0..abadbfa9b 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d1131712e..890065235 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 3d3fe9153..19b2862a9 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 05b60eb56..628994858 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 6d5a87575..f0096085e 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 575359ed9..bee540d50 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 @@ -74,4 +74,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 9eeeb869b..2be520d30 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 ClientboundForgetLevelChunkPacket(ByteBuf in, MinecraftCodecHelper helper 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 5b0336128..360cd8916 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 32f9aaf04..a8e61b254 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 acd0eed31..03c023493 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 0f9de3cb5..b200f7380 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 @@ -53,4 +53,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 5936d1b31..0cc8e757c 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 4837cfdb3..a17e2365b 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 648012a3f..7aa3c71e1 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d086e63ef..3a06ead20 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 bf91c0a17..0ad5d3e5f 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 f77f67762..f62ba2b64 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 ClientboundSetChunkCacheRadiusPacket(ByteBuf in, MinecraftCodecHelper hel 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 dfce1a774..33ecbf8c0 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 4f42d4839..fae66ec7f 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 ClientboundSetSimulationDistancePacket(ByteBuf in, MinecraftCodecHelper h 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 bf84e1d4d..fac192093 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 @@ -24,4 +24,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeLong(this.worldAge); out.writeLong(this.time); } + + @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 039cf812b..405773b92 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 260cbf463..cffebe1c3 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 a6af2fbaa..2df7809f8 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 89d033a62..a3b995b39 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 722b8e4a8..124e6bf63 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 e3487bd15..b2c765c6a 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 ClientboundSetBorderSizePacket(ByteBuf in, MinecraftCodecHelper helper) { 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 c5bca0b8f..525c33477 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 ClientboundSetBorderWarningDelayPacket(ByteBuf in, MinecraftCodecHelper h 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 a6e5e281d..1602c56b6 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 ClientboundSetBorderWarningDistancePacket(ByteBuf in, MinecraftCodecHelpe 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 1769f6830..4f8e728a2 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 65aec273a..ad4902bc3 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 a316cb97c..9906f5fc2 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 4b4d17675..d15c03cf6 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 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/clientbound/scoreboard/ClientboundSetScorePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetScorePacket.java index 9bd5faddd..bf6aa6171 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 f5832debb..d1ee66309 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 ClientboundClearTitlesPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 190ffc6ef..2adb5f959 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 ClientboundSetActionBarTextPacket(ByteBuf in, MinecraftCodecHelper helper 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 220fe1f9e..5c6b9de8e 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 ClientboundSetSubtitleTextPacket(ByteBuf in, MinecraftCodecHelper helper) 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 890abbe66..e5ec2fab3 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 ClientboundSetTitleTextPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 d5e02bbe0..341d0cc5c 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 ba8790e51..74bee265a 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 ServerboundChangeDifficultyPacket(ByteBuf in, MinecraftCodecHelper helper 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 c3934feeb..e1c0564e9 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 f13f49a72..646f797f0 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 ServerboundClientCommandPacket(ByteBuf in, MinecraftCodecHelper helper) { 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/ServerboundCommandSuggestionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundCommandSuggestionPacket.java index 2d004475e..d39f25bab 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d7781a69d..780292b67 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 ServerboundDebugSampleSubscriptionPacket(ByteBuf in, MinecraftCodecHelper 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 70be72a12..502eac9c2 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 ServerboundLockDifficultyPacket(ByteBuf in, MinecraftCodecHelper helper) 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/inventory/ServerboundContainerButtonClickPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerButtonClickPacket.java index 44d444413..b707e2db8 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 065957a06..34a2ce083 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d32e99d29..cf703db49 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 ServerboundContainerClosePacket(ByteBuf in, MinecraftCodecHelper helper) public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeByte(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 164cd1119..17f3fe9f1 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/ServerboundPickItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemPacket.java index dd6d1b316..35d5b6a39 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemPacket.java @@ -21,4 +21,9 @@ public ServerboundPickItemPacket(ByteBuf in, MinecraftCodecHelper helper) { 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/ServerboundPlaceRecipePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPlaceRecipePacket.java index 5279c8e10..26c813f1b 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeString(out, this.recipeId); out.writeBoolean(this.makeAll); } + + @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 3d22b0c11..0781b1895 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 615a5efb7..a56523f52 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 ServerboundRecipeBookSeenRecipePacket(ByteBuf in, MinecraftCodecHelper he public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeString(out, this.recipeId); } + + @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 c9dbe2331..dfc30953a 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 ServerboundRenameItemPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 f0f9a3d90..c4bcb8748 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { }; 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 e32fc3b23..d6403ab09 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 ServerboundSelectTradePacket(ByteBuf in, MinecraftCodecHelper helper) { 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 9540a7b23..c1d01369c 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 c15cfd6df..5c010b02d 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 8adb43e4c..009165969 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 35c5c0e62..66f7d2e48 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d49dc500b..03c34443b 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 ccbec9602..30042ca0a 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 95cbe531f..fb4657d1a 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 ServerboundAcceptTeleportationPacket(ByteBuf in, MinecraftCodecHelper hel 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 6aa8b0904..b8cf0042d 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 3f981a2e4..6a07dbe62 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 ServerboundChunkBatchReceivedPacket(ByteBuf in, MinecraftCodecHelper help 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 241605965..54399cf3f 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 3febebaf8..5fc4e305e 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 7672d0b68..a136ea4cf 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeFloat(this.yaw); out.writeFloat(this.pitch); } + + @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 8bacc3faa..0bb4eaf41 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 e039dc8a5..5c641fea4 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 @@ -44,4 +44,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d45f23236..3118904a8 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 ServerboundTeleportToEntityPacket(ByteBuf in, MinecraftCodecHelper helper 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 f95daa95d..98d0b0b0a 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { } 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 087f358f8..1dee645bd 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 @@ -30,4 +30,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeDouble(this.z); out.writeBoolean(this.onGround); } + + @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 63a23cc26..dfe1d083e 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 @@ -36,4 +36,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeFloat(this.pitch); out.writeBoolean(this.onGround); } + + @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 24363b8c1..91aa4541d 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 @@ -27,4 +27,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeFloat(this.pitch); out.writeBoolean(this.onGround); } + + @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 ba51d6104..4357a60e9 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 @@ -21,4 +21,9 @@ public ServerboundMovePlayerStatusOnlyPacket(ByteBuf in, MinecraftCodecHelper he public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeBoolean(this.onGround); } + + @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 2410115ad..754b4fc5a 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 0d3084967..67abac25e 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 5ef559c15..00c2a2d8f 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 26a0a7cd3..4dd18d9f8 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 ServerboundSetCarriedItemPacket(ByteBuf in, MinecraftCodecHelper helper) 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 744e454ea..0beaaf732 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 ServerboundSwingPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 3f330fa50..33b92eed3 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 @@ -46,4 +46,9 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeBoolean(this.insideBlock); 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 bdf926397..19c7b9f64 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/ClientboundGameProfilePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundGameProfilePacket.java index 37099e9ba..932d36853 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundGameProfilePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundGameProfilePacket.java @@ -31,11 +31,6 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeBoolean(this.strictErrorHandling); } - @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/clientbound/ClientboundHelloPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundHelloPacket.java index 144ddaed0..4ae1f0193 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 26a9fba94..33ee3410f 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 ClientboundLoginCompressionPacket(ByteBuf in, MinecraftCodecHelper helper 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 444412040..37a1b2911 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 ClientboundLoginDisconnectPacket(ByteBuf in, MinecraftCodecHelper helper) 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/serverbound/ServerboundHelloPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundHelloPacket.java index 0691788ac..141834e76 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 d4337237c..65415e26b 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 011a36f0b..ff0d8b14d 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 ef9b16ba5..dceb274c3 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 52f609def..bda267cae 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 18c877821..c8e90d386 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 { From 7fd279b6ace9867fd402a5ff6869b6316d47f477 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 3 Nov 2024 09:32:03 +0100 Subject: [PATCH 2/3] Add new ticking info for 1.21.3 Notable info: ServerboundSelectBundleItemPacket is not ticked, it's instant ClientboundSetHeldSlotPacket is already ticked as it is just renamed ClientboundSetCarriedItemPacket --- .../ingame/clientbound/ClientboundRecipeBookAddPacket.java | 5 +++++ .../clientbound/ClientboundRecipeBookRemovePacket.java | 5 +++++ .../clientbound/ClientboundRecipeBookSettingsPacket.java | 5 +++++ .../entity/ClientboundEntityPositionSyncPacket.java | 5 +++++ .../clientbound/entity/ClientboundMoveMinecartPacket.java | 5 +++++ .../entity/player/ClientboundPlayerRotationPacket.java | 5 +++++ .../inventory/ClientboundSetCursorItemPacket.java | 5 +++++ .../inventory/ClientboundSetPlayerInventoryPacket.java | 5 +++++ .../ingame/serverbound/ServerboundClientTickEndPacket.java | 5 +++++ 9 files changed, 45 insertions(+) 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 9ff4208c0..9a0aeebcd 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 6f8f311db..38598ef46 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 57e405878..6fc53a173 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 void serialize(ByteBuf buf, MinecraftCodecHelper helper) { } } + @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/entity/ClientboundEntityPositionSyncPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityPositionSyncPacket.java index 95d93b610..43786e1ef 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/ClientboundMoveMinecartPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveMinecartPacket.java index 0c1f8e0da..4968917d0 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/player/ClientboundPlayerRotationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerRotationPacket.java index b9acd6312..dd467efed 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/inventory/ClientboundSetCursorItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetCursorItemPacket.java index 643a1f731..220f56ebf 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 ClientboundSetCursorItemPacket(ByteBuf in, MinecraftCodecHelper helper) { 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 a7c929fc1..403d1aa74 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 void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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/serverbound/ServerboundClientTickEndPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientTickEndPacket.java index 8b9381eee..ecebd1da9 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; + } } From 5637fbedaf860d216bde51a0d53ea6db25099bd1 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 3 Nov 2024 18:54:05 +0100 Subject: [PATCH 3/3] Expose packet handler executor --- .../mcprotocollib/network/tcp/TcpClientSession.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 53364cb32..50d679b40 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 @@ -43,6 +43,7 @@ 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; @@ -76,7 +77,11 @@ public TcpClientSession(String host, int port, String bindAddress, int bindPort, } public TcpClientSession(String host, int port, String bindAddress, int bindPort, PacketProtocol protocol, ProxyInfo proxy) { - super(host, port, protocol, DefaultPacketHandlerExecutor.createExecutor()); + 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;