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/5] 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 94d68197..b358378e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/packet/Packet.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/packet/Packet.java @@ -9,13 +9,14 @@ import org.geysermc.mcprotocollib.network.Session; public interface Packet { /** - * Gets whether the packet has handling priority. - * If the result is true, the packet will be handled immediately after being - * decoded. + * Gets whether the packet should run on an async game thread rather than blocking the network (Netty) thread. + * Packets that qualify for this are usually packets with an ensureRunningOnSameThread call at the top of their packet listener method in the Minecraft code. + * Packets which need extra attention because they aren't "fully" handled async are marked using. + * // GAME THREAD DETAIL comments in the MCProtocolLib code. * - * @return Whether the packet has priority. + * @return Whether the packet be handled async from the Netty thread. */ - default boolean isPriority() { + default boolean shouldRunOnGameThread() { return false; } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/DefaultPacketHandlerExecutor.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/DefaultPacketHandlerExecutor.java new file mode 100644 index 00000000..e9cb75b4 --- /dev/null +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/DefaultPacketHandlerExecutor.java @@ -0,0 +1,34 @@ +package org.geysermc.mcprotocollib.network.tcp; + +import io.netty.channel.DefaultEventLoopGroup; +import io.netty.channel.EventLoopGroup; +import io.netty.util.concurrent.DefaultThreadFactory; + +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; + +public class DefaultPacketHandlerExecutor { + /** + * Controls whether non-priority packets are handled in a separate event loop + */ + public static boolean USE_EVENT_LOOP_FOR_PACKETS = true; + private static EventLoopGroup PACKET_EVENT_LOOP; + private static final int SHUTDOWN_QUIET_PERIOD_MS = 100; + private static final int SHUTDOWN_TIMEOUT_MS = 500; + + public static Executor createExecutor() { + if (!USE_EVENT_LOOP_FOR_PACKETS) { + return Runnable::run; + } + + if (PACKET_EVENT_LOOP == null) { + // See TcpClientSession.newThreadFactory() for details on + // daemon threads and their interaction with the runtime. + PACKET_EVENT_LOOP = new DefaultEventLoopGroup(new DefaultThreadFactory(DefaultPacketHandlerExecutor.class, true)); + Runtime.getRuntime().addShutdownHook(new Thread( + () -> PACKET_EVENT_LOOP.shutdownGracefully(SHUTDOWN_QUIET_PERIOD_MS, SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS))); + } + + return PACKET_EVENT_LOOP.next(); + } +} diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpClientSession.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpClientSession.java index 4c3ac62f..53364cb3 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 class TcpClientSession extends TcpSession { } 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 f8477930..27b64c11 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 f17fa910..7af102dd 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpSession.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpSession.java @@ -3,11 +3,7 @@ package org.geysermc.mcprotocollib.network.tcp; import io.netty.channel.Channel; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.DefaultEventLoopGroup; -import io.netty.channel.EventLoop; -import io.netty.channel.EventLoopGroup; import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.util.concurrent.DefaultThreadFactory; import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; @@ -33,24 +29,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.Executor; import java.util.concurrent.TimeoutException; public abstract class TcpSession extends SimpleChannelInboundHandler implements Session { private static final Logger log = LoggerFactory.getLogger(TcpSession.class); - /** - * Controls whether non-priority packets are handled in a separate event loop - */ - public static boolean USE_EVENT_LOOP_FOR_PACKETS = true; - private static EventLoopGroup PACKET_EVENT_LOOP; - private static final int SHUTDOWN_QUIET_PERIOD_MS = 100; - private static final int SHUTDOWN_TIMEOUT_MS = 500; - protected String host; protected int port; private final PacketProtocol protocol; - private final EventLoop eventLoop = createEventLoop(); + private final Executor packetHandlerExecutor; private final Map flags = new HashMap<>(); private final List listeners = new CopyOnWriteArrayList<>(); @@ -58,10 +46,11 @@ public abstract class TcpSession extends SimpleChannelInboundHandler imp private Channel channel; protected boolean disconnected = false; - public TcpSession(String host, int port, PacketProtocol protocol) { + public TcpSession(String host, int port, PacketProtocol protocol, Executor packetHandlerExecutor) { this.host = host; this.port = port; this.protocol = protocol; + this.packetHandlerExecutor = packetHandlerExecutor; } @Override @@ -269,21 +258,6 @@ public abstract class TcpSession extends SimpleChannelInboundHandler imp } } - private @Nullable EventLoop createEventLoop() { - if (!USE_EVENT_LOOP_FOR_PACKETS) { - return null; - } - - if (PACKET_EVENT_LOOP == null) { - // See TcpClientSession.newThreadFactory() for details on - // daemon threads and their interaction with the runtime. - PACKET_EVENT_LOOP = new DefaultEventLoopGroup(new DefaultThreadFactory(this.getClass(), true)); - Runtime.getRuntime().addShutdownHook(new Thread( - () -> PACKET_EVENT_LOOP.shutdownGracefully(SHUTDOWN_QUIET_PERIOD_MS, SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS))); - } - return PACKET_EVENT_LOOP.next(); - } - @Override public Channel getChannel() { return this.channel; @@ -322,8 +296,8 @@ public abstract class TcpSession extends SimpleChannelInboundHandler imp @Override protected void channelRead0(ChannelHandlerContext ctx, Packet packet) { - if (!packet.isPriority() && eventLoop != null) { - eventLoop.execute(() -> this.callPacketReceived(packet)); + if (packet.shouldRunOnGameThread()) { + packetHandlerExecutor.execute(() -> this.callPacketReceived(packet)); } else { this.callPacketReceived(packet); } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java index ad017f61..780b00ce 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java @@ -37,9 +37,9 @@ import org.geysermc.mcprotocollib.protocol.packet.login.clientbound.ClientboundL import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundHelloPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundLoginAcknowledgedPacket; -import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundPongResponsePacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.clientbound.ClientboundPongResponsePacket; import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundStatusResponsePacket; -import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundPingRequestPacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.serverbound.ServerboundPingRequestPacket; import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundStatusRequestPacket; import javax.crypto.KeyGenerator; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java index 5de06928..9a59410b 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java @@ -35,9 +35,9 @@ import org.geysermc.mcprotocollib.protocol.packet.login.clientbound.ClientboundL import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundHelloPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundLoginAcknowledgedPacket; -import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundPongResponsePacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.clientbound.ClientboundPongResponsePacket; import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundStatusResponsePacket; -import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundPingRequestPacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.serverbound.ServerboundPingRequestPacket; import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundStatusRequestPacket; import javax.crypto.SecretKey; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java index f3ccc98a..1b17aab5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java @@ -1,7 +1,7 @@ package org.geysermc.mcprotocollib.protocol.codec; import org.geysermc.mcprotocollib.protocol.data.ProtocolState; -import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundCookieRequestPacket; +import org.geysermc.mcprotocollib.protocol.packet.cookie.clientbound.ClientboundCookieRequestPacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundCustomPayloadPacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundCustomReportDetailsPacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundDisconnectPacket; @@ -13,7 +13,7 @@ import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.Clientbound import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundStoreCookiePacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundTransferPacket; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundUpdateTagsPacket; -import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ServerboundCookieResponsePacket; +import org.geysermc.mcprotocollib.protocol.packet.cookie.serverbound.ServerboundCookieResponsePacket; import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundClientInformationPacket; import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundCustomPayloadPacket; import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundKeepAlivePacket; @@ -198,9 +198,9 @@ import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundC import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundHelloPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundKeyPacket; import org.geysermc.mcprotocollib.protocol.packet.login.serverbound.ServerboundLoginAcknowledgedPacket; -import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundPongResponsePacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.clientbound.ClientboundPongResponsePacket; import org.geysermc.mcprotocollib.protocol.packet.status.clientbound.ClientboundStatusResponsePacket; -import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundPingRequestPacket; +import org.geysermc.mcprotocollib.protocol.packet.ping.serverbound.ServerboundPingRequestPacket; import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.ServerboundStatusRequestPacket; public class MinecraftCodec { diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomPayloadPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomPayloadPacket.java index fcd917ee..8f7eca9e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomPayloadPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomPayloadPacket.java @@ -26,4 +26,10 @@ public class ClientboundCustomPayloadPacket implements MinecraftPacket { helper.writeResourceLocation(out, this.channel); out.writeBytes(this.data); } + + @Override + public boolean shouldRunOnGameThread() { + // GAME THREAD DETAIL: Only non-discarded payloads are handled async. + return false; // False, you need to handle making it async yourself + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomReportDetailsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomReportDetailsPacket.java index 17d144c3..891e9317 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomReportDetailsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCustomReportDetailsPacket.java @@ -33,4 +33,9 @@ public class ClientboundCustomReportDetailsPacket implements MinecraftPacket { helper.writeString(out, entry.getValue()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundDisconnectPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundDisconnectPacket.java index cf9b05a1..927dacc2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundDisconnectPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundDisconnectPacket.java @@ -28,9 +28,4 @@ public class ClientboundDisconnectPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeComponent(out, this.reason); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundPingPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundPingPacket.java index b11c4bfd..b09f29a5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundPingPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundPingPacket.java @@ -21,4 +21,9 @@ public class ClientboundPingPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeInt(this.id); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPopPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPopPacket.java index 5d63071b..4f8d4019 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPopPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPopPacket.java @@ -28,4 +28,9 @@ public class ClientboundResourcePackPopPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeNullable(out, this.id, helper::writeUUID); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPushPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPushPacket.java index 4aec3c92..edc123a8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPushPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundResourcePackPushPacket.java @@ -38,4 +38,9 @@ public class ClientboundResourcePackPushPacket implements MinecraftPacket { out.writeBoolean(this.required); helper.writeNullable(out, this.prompt, helper::writeComponent); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundServerLinksPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundServerLinksPacket.java index e6a28a10..6cd53982 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundServerLinksPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundServerLinksPacket.java @@ -52,4 +52,9 @@ public class ClientboundServerLinksPacket implements MinecraftPacket { helper.writeString(out, link.link()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundStoreCookiePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundStoreCookiePacket.java index a7a9753c..22eec45f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundStoreCookiePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundStoreCookiePacket.java @@ -25,4 +25,9 @@ public class ClientboundStoreCookiePacket implements MinecraftPacket { helper.writeResourceLocation(out, this.key); helper.writeByteArray(out, this.payload); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundTransferPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundTransferPacket.java index 2bc8d109..72fbc2d7 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundTransferPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundTransferPacket.java @@ -24,4 +24,10 @@ public class ClientboundTransferPacket implements MinecraftPacket { helper.writeString(out, this.host); helper.writeVarInt(out, this.port); } + + @Override + public boolean shouldRunOnGameThread() { + // GAME THREAD DETAIL: Code runs before packet is made async. + return false; // False, you need to handle making it async yourself + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundUpdateTagsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundUpdateTagsPacket.java index 0bfff1fe..b09104f2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundUpdateTagsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundUpdateTagsPacket.java @@ -53,4 +53,9 @@ public class ClientboundUpdateTagsPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundClientInformationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundClientInformationPacket.java index 51e82c1f..40922f9e 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 class ServerboundClientInformationPacket implements MinecraftPacket { 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 1bdcef7f..c2944d93 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundResourcePackPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/serverbound/ServerboundResourcePackPacket.java @@ -29,4 +29,9 @@ public class ServerboundResourcePackPacket implements MinecraftPacket { helper.writeUUID(out, id); helper.writeVarInt(out, this.status.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundFinishConfigurationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundFinishConfigurationPacket.java index f248a38c..69549f6d 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundFinishConfigurationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundFinishConfigurationPacket.java @@ -16,6 +16,11 @@ public class ClientboundFinishConfigurationPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + @Override public boolean isTerminal() { return true; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundRegistryDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundRegistryDataPacket.java index 9512ef4a..6f5fd3d9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundRegistryDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundRegistryDataPacket.java @@ -31,4 +31,9 @@ public class ClientboundRegistryDataPacket implements MinecraftPacket { helper.writeNullable(buf, entry.getData(), helper::writeAnyTag); }); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundSelectKnownPacks.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundSelectKnownPacks.java index e5dfa96f..c7e2c748 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundSelectKnownPacks.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/clientbound/ClientboundSelectKnownPacks.java @@ -28,4 +28,9 @@ public class ClientboundSelectKnownPacks implements MinecraftPacket { helper.writeString(buf, entry.getVersion()); }); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundFinishConfigurationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundFinishConfigurationPacket.java index 75147f6c..d3d68b2a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundFinishConfigurationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundFinishConfigurationPacket.java @@ -16,6 +16,11 @@ public class ServerboundFinishConfigurationPacket implements MinecraftPacket { public void serialize(ByteBuf buf, MinecraftCodecHelper helper) { } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + @Override public boolean isTerminal() { return true; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundSelectKnownPacks.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundSelectKnownPacks.java index d8cfd6d7..12f67f5c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundSelectKnownPacks.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/configuration/serverbound/ServerboundSelectKnownPacks.java @@ -39,4 +39,9 @@ public class ServerboundSelectKnownPacks implements MinecraftPacket { helper.writeString(out, entry.getVersion()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCookieRequestPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/clientbound/ClientboundCookieRequestPacket.java similarity index 82% rename from protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCookieRequestPacket.java rename to protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/clientbound/ClientboundCookieRequestPacket.java index df2ed423..29c77cac 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ClientboundCookieRequestPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/clientbound/ClientboundCookieRequestPacket.java @@ -1,4 +1,4 @@ -package org.geysermc.mcprotocollib.protocol.packet.common.clientbound; +package org.geysermc.mcprotocollib.protocol.packet.cookie.clientbound; import io.netty.buffer.ByteBuf; import lombok.AllArgsConstructor; @@ -22,4 +22,9 @@ public class ClientboundCookieRequestPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeResourceLocation(out, this.key); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ServerboundCookieResponsePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/serverbound/ServerboundCookieResponsePacket.java similarity index 93% rename from protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ServerboundCookieResponsePacket.java rename to protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/serverbound/ServerboundCookieResponsePacket.java index 66afbff0..6f831cb4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/common/clientbound/ServerboundCookieResponsePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/cookie/serverbound/ServerboundCookieResponsePacket.java @@ -1,4 +1,4 @@ -package org.geysermc.mcprotocollib.protocol.packet.common.clientbound; +package org.geysermc.mcprotocollib.protocol.packet.cookie.serverbound; import io.netty.buffer.ByteBuf; import lombok.AllArgsConstructor; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/handshake/serverbound/ClientIntentionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/handshake/serverbound/ClientIntentionPacket.java index d1799dbc..b1d01b5e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/handshake/serverbound/ClientIntentionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/handshake/serverbound/ClientIntentionPacket.java @@ -33,11 +33,6 @@ public class ClientIntentionPacket implements MinecraftPacket { helper.writeVarInt(out, this.intent.ordinal() + 1); } - @Override - public boolean isPriority() { - return true; - } - @Override public boolean isTerminal() { return true; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundAwardStatsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundAwardStatsPacket.java index 3c281514..d2fdaf89 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundAwardStatsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundAwardStatsPacket.java @@ -91,4 +91,9 @@ public class ClientboundAwardStatsPacket implements MinecraftPacket { helper.writeVarInt(out, entry.getIntValue()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBossEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBossEventPacket.java index 3e4aef6d..fb3acf91 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBossEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBossEventPacket.java @@ -138,4 +138,9 @@ public class ClientboundBossEventPacket implements MinecraftPacket { out.writeByte(flags); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBundlePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBundlePacket.java index 8bf5c7a8..8da8f173 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBundlePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundBundlePacket.java @@ -16,4 +16,9 @@ public class ClientboundBundlePacket implements MinecraftPacket { @Override public void serialize(ByteBuf buf, MinecraftCodecHelper helper) { } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundChangeDifficultyPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundChangeDifficultyPacket.java index e0d6af7b..c2370a70 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundChangeDifficultyPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundChangeDifficultyPacket.java @@ -26,4 +26,9 @@ public class ClientboundChangeDifficultyPacket implements MinecraftPacket { out.writeByte(this.difficulty.ordinal()); out.writeBoolean(this.difficultyLocked); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandSuggestionsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandSuggestionsPacket.java index ccf5b8ae..9fd73fb4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandSuggestionsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandSuggestionsPacket.java @@ -62,4 +62,9 @@ public class ClientboundCommandSuggestionsPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandsPacket.java index 9187c49a..d9954acd 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCommandsPacket.java @@ -300,4 +300,9 @@ public class ClientboundCommandsPacket implements MinecraftPacket { helper.writeVarInt(out, this.firstNodeIndex); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCooldownPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCooldownPacket.java index ea49bacf..26140724 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 class ClientboundCooldownPacket implements MinecraftPacket { 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 4192925f..a612d097 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCustomChatCompletionsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundCustomChatCompletionsPacket.java @@ -31,4 +31,9 @@ public class ClientboundCustomChatCompletionsPacket implements MinecraftPacket { helper.writeString(out, entry); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDeleteChatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDeleteChatPacket.java index 66a5ee4c..62f6f903 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDeleteChatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDeleteChatPacket.java @@ -25,4 +25,9 @@ public class ClientboundDeleteChatPacket implements MinecraftPacket { out.writeBytes(messageSignature.getMessageSignature()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDelimiterPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDelimiterPacket.java index f99402be..57f9feed 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 class ClientboundDelimiterPacket implements MinecraftPacket { @Override public void serialize(ByteBuf out, MinecraftCodecHelper helper) { } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDisguisedChatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDisguisedChatPacket.java index 15d236e9..01de2bee 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDisguisedChatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundDisguisedChatPacket.java @@ -35,4 +35,9 @@ public class ClientboundDisguisedChatPacket implements MinecraftPacket { helper.writeComponent(out, this.name); helper.writeNullable(out, this.targetName, helper::writeComponent); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundLoginPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundLoginPacket.java index 8465b904..f2c0d385 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundLoginPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundLoginPacket.java @@ -61,4 +61,9 @@ public class ClientboundLoginPacket implements MinecraftPacket { helper.writePlayerSpawnInfo(out, this.commonPlayerSpawnInfo); out.writeBoolean(this.enforcesSecureChat); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerChatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerChatPacket.java index 746f0792..672369f9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerChatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerChatPacket.java @@ -84,4 +84,9 @@ public class ClientboundPlayerChatPacket implements MinecraftPacket { helper.writeComponent(out, this.name); helper.writeNullable(out, this.targetName, helper::writeComponent); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoRemovePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoRemovePacket.java index 041534e7..09807c08 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoRemovePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoRemovePacket.java @@ -23,4 +23,9 @@ public class ClientboundPlayerInfoRemovePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeList(out, this.profileIds, helper::writeUUID); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundPlayerInfoUpdatePacket.java index 07a0b638..b2157412 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 class ClientboundPlayerInfoUpdatePacket implements MinecraftPacket { } } } + + @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 844f1b18..963099ea 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 class ClientboundRecipePacket implements MinecraftPacket { 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 555ea176..4a1cc0fb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRespawnPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRespawnPacket.java @@ -39,4 +39,9 @@ public class ClientboundRespawnPacket implements MinecraftPacket { } out.writeByte(dataToKeep); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSelectAdvancementsTabPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSelectAdvancementsTabPacket.java index a38e24bd..ccb551bb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSelectAdvancementsTabPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSelectAdvancementsTabPacket.java @@ -22,4 +22,9 @@ public class ClientboundSelectAdvancementsTabPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeNullable(out, this.tabId, helper::writeString); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundServerDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundServerDataPacket.java index 34f139e1..c1f8f7da 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundServerDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundServerDataPacket.java @@ -26,4 +26,9 @@ public class ClientboundServerDataPacket implements MinecraftPacket { helper.writeComponent(out, this.motd); helper.writeNullable(out, this.iconBytes, helper::writeByteArray); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSetCameraPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSetCameraPacket.java index 0cb0232e..6c5d6d3b 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSetCameraPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSetCameraPacket.java @@ -21,4 +21,9 @@ public class ClientboundSetCameraPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.cameraEntityId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSoundEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSoundEntityPacket.java index ec985958..d227d5b8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSoundEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSoundEntityPacket.java @@ -46,4 +46,9 @@ public class ClientboundSoundEntityPacket implements MinecraftPacket { out.writeFloat(this.pitch); out.writeLong(this.seed); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStartConfigurationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStartConfigurationPacket.java index d7844e6e..5510c57e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStartConfigurationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStartConfigurationPacket.java @@ -16,6 +16,11 @@ public class ClientboundStartConfigurationPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + @Override public boolean isTerminal() { return true; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStopSoundPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStopSoundPacket.java index cc20b54b..1d4c45c8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStopSoundPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundStopSoundPacket.java @@ -55,4 +55,9 @@ public class ClientboundStopSoundPacket implements MinecraftPacket { helper.writeResourceLocation(out, this.sound); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSystemChatPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSystemChatPacket.java index 682a9de4..9b799930 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSystemChatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundSystemChatPacket.java @@ -25,4 +25,9 @@ public class ClientboundSystemChatPacket implements MinecraftPacket { helper.writeComponent(out, this.content); out.writeBoolean(this.overlay); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTabListPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTabListPacket.java index b80fdea4..fc1956ad 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTabListPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTabListPacket.java @@ -26,4 +26,9 @@ public class ClientboundTabListPacket implements MinecraftPacket { helper.writeComponent(out, this.header); helper.writeComponent(out, this.footer); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStatePacket.java index fa468096..8f928d5e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStatePacket.java @@ -25,4 +25,9 @@ public class ClientboundTickingStatePacket implements MinecraftPacket { out.writeFloat(tickRate); out.writeBoolean(isFrozen); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStepPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStepPacket.java index 0898a134..4e53f5c4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStepPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundTickingStepPacket.java @@ -22,4 +22,9 @@ public class ClientboundTickingStepPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.tickSteps); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateAdvancementsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateAdvancementsPacket.java index 8293a17c..ed900580 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateAdvancementsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateAdvancementsPacket.java @@ -166,4 +166,9 @@ public class ClientboundUpdateAdvancementsPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateRecipesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundUpdateRecipesPacket.java index 7c72d58b..b7b55867 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 class ClientboundUpdateRecipesPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundAnimatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundAnimatePacket.java index 6dca267a..80e08033 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundAnimatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundAnimatePacket.java @@ -30,4 +30,9 @@ public class ClientboundAnimatePacket implements MinecraftPacket { out.writeByte(this.animation.getId()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundDamageEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundDamageEventPacket.java index a94a1239..aef01afc 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundDamageEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundDamageEventPacket.java @@ -41,4 +41,9 @@ public class ClientboundDamageEventPacket implements MinecraftPacket { out.writeBoolean(false); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityEventPacket.java index 84a2d07b..c3b363df 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityEventPacket.java @@ -26,4 +26,9 @@ public class ClientboundEntityEventPacket implements MinecraftPacket { out.writeInt(this.entityId); helper.writeEntityEvent(out, this.event); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundHurtAnimationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundHurtAnimationPacket.java index d7a6b032..bb30ea71 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundHurtAnimationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundHurtAnimationPacket.java @@ -24,4 +24,9 @@ public class ClientboundHurtAnimationPacket implements MinecraftPacket { helper.writeVarInt(out, this.id); out.writeFloat(this.yaw); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosPacket.java index 5afa47e2..d7a2a21f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosPacket.java @@ -33,4 +33,9 @@ public class ClientboundMoveEntityPosPacket implements MinecraftPacket { out.writeShort((int) (this.moveZ * 4096)); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosRotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosRotPacket.java index ba561136..f690ec62 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosRotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityPosRotPacket.java @@ -39,4 +39,9 @@ public class ClientboundMoveEntityPosRotPacket implements MinecraftPacket { out.writeByte((byte) (this.pitch * 256 / 360)); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityRotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityRotPacket.java index 6099fc77..4599f9d4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityRotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveEntityRotPacket.java @@ -30,4 +30,9 @@ public class ClientboundMoveEntityRotPacket implements MinecraftPacket { out.writeByte((byte) (this.pitch * 256 / 360)); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveVehiclePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveVehiclePacket.java index 989860d0..e45196ef 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 class ClientboundMoveVehiclePacket implements MinecraftPacket { 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 81f41311..4093f786 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundProjectilePowerPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundProjectilePowerPacket.java @@ -24,4 +24,9 @@ public class ClientboundProjectilePowerPacket implements MinecraftPacket { helper.writeVarInt(out, this.id); out.writeDouble(this.accelerationPower); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveEntitiesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveEntitiesPacket.java index 96dc1b0e..44aba673 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveEntitiesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveEntitiesPacket.java @@ -28,4 +28,9 @@ public class ClientboundRemoveEntitiesPacket implements MinecraftPacket { helper.writeVarInt(out, entityId); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveMobEffectPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveMobEffectPacket.java index 81ac0968..b6fc0da1 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveMobEffectPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRemoveMobEffectPacket.java @@ -26,4 +26,9 @@ public class ClientboundRemoveMobEffectPacket implements MinecraftPacket { helper.writeVarInt(out, this.entityId); helper.writeEffect(out, this.effect); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRotateHeadPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRotateHeadPacket.java index 3b769fd5..ab5197c0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRotateHeadPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundRotateHeadPacket.java @@ -24,4 +24,9 @@ public class ClientboundRotateHeadPacket implements MinecraftPacket { helper.writeVarInt(out, this.entityId); out.writeByte((byte) (this.headYaw * 256 / 360)); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityDataPacket.java index 22081f45..bf0c8038 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityDataPacket.java @@ -26,4 +26,9 @@ public class ClientboundSetEntityDataPacket implements MinecraftPacket { helper.writeVarInt(out, this.entityId); helper.writeEntityMetadata(out, this.metadata); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityLinkPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityLinkPacket.java index d91fd9e1..b1da4dba 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityLinkPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityLinkPacket.java @@ -24,4 +24,9 @@ public class ClientboundSetEntityLinkPacket implements MinecraftPacket { out.writeInt(this.entityId); out.writeInt(this.attachedToId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityMotionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityMotionPacket.java index fe2c9617..58ff798c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityMotionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEntityMotionPacket.java @@ -30,4 +30,9 @@ public class ClientboundSetEntityMotionPacket implements MinecraftPacket { out.writeShort((int) (this.motionY * 8000)); out.writeShort((int) (this.motionZ * 8000)); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEquipmentPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEquipmentPacket.java index 95eb9c6b..1cc09702 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEquipmentPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetEquipmentPacket.java @@ -47,4 +47,9 @@ public class ClientboundSetEquipmentPacket implements MinecraftPacket { helper.writeOptionalItemStack(out, this.equipment[i].getItem()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetPassengersPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetPassengersPacket.java index 2a479e7b..0bdee16e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetPassengersPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundSetPassengersPacket.java @@ -31,4 +31,9 @@ public class ClientboundSetPassengersPacket implements MinecraftPacket { helper.writeVarInt(out, entityId); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTakeItemEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTakeItemEntityPacket.java index 5e28f50e..b9f4e227 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTakeItemEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTakeItemEntityPacket.java @@ -27,4 +27,9 @@ public class ClientboundTakeItemEntityPacket implements MinecraftPacket { helper.writeVarInt(out, this.collectorEntityId); helper.writeVarInt(out, this.itemCount); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTeleportEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundTeleportEntityPacket.java index 565b84d3..cce01b87 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 class ClientboundTeleportEntityPacket implements MinecraftPacket { out.writeByte((byte) (this.pitch * 256 / 360)); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateAttributesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateAttributesPacket.java index 4fe3b57f..e20ea7e9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateAttributesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateAttributesPacket.java @@ -54,4 +54,9 @@ public class ClientboundUpdateAttributesPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateMobEffectPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateMobEffectPacket.java index 985c2dfe..478e048c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateMobEffectPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundUpdateMobEffectPacket.java @@ -63,4 +63,9 @@ public class ClientboundUpdateMobEffectPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundBlockChangedAckPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundBlockChangedAckPacket.java index 9b1e1880..cf916aba 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundBlockChangedAckPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundBlockChangedAckPacket.java @@ -21,4 +21,9 @@ public class ClientboundBlockChangedAckPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.sequence); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerAbilitiesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerAbilitiesPacket.java index f18dfa58..071e728c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerAbilitiesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerAbilitiesPacket.java @@ -58,4 +58,9 @@ public class ClientboundPlayerAbilitiesPacket implements MinecraftPacket { out.writeFloat(this.flySpeed); out.writeFloat(this.walkSpeed); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerCombatKillPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerCombatKillPacket.java index 7dd83493..f4c94d38 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerCombatKillPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerCombatKillPacket.java @@ -25,4 +25,9 @@ public class ClientboundPlayerCombatKillPacket implements MinecraftPacket { helper.writeVarInt(out, this.playerId); helper.writeComponent(out, this.message); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerLookAtPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerLookAtPacket.java index c9862d03..a8f60bbb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerLookAtPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerLookAtPacket.java @@ -55,4 +55,9 @@ public class ClientboundPlayerLookAtPacket implements MinecraftPacket { out.writeBoolean(false); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerPositionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerPositionPacket.java index f5465a7f..389f987c 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 class ClientboundPlayerPositionPacket implements MinecraftPacket { 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 9ebe13aa..d390c469 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 class ClientboundSetCarriedItemPacket implements MinecraftPacket { 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 ae1e9004..ff68090c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetExperiencePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetExperiencePacket.java @@ -27,4 +27,9 @@ public class ClientboundSetExperiencePacket implements MinecraftPacket { helper.writeVarInt(out, this.level); helper.writeVarInt(out, this.totalExperience); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHealthPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHealthPacket.java index e6747eaa..43c99a87 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHealthPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundSetHealthPacket.java @@ -27,4 +27,9 @@ public class ClientboundSetHealthPacket implements MinecraftPacket { helper.writeVarInt(out, this.food); out.writeFloat(this.saturation); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddEntityPacket.java index 14213e0e..f6aa245e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddEntityPacket.java @@ -120,4 +120,9 @@ public class ClientboundAddEntityPacket implements MinecraftPacket { out.writeShort((int) (this.motionY * 8000)); out.writeShort((int) (this.motionZ * 8000)); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddExperienceOrbPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddExperienceOrbPacket.java index d5531bbb..ece0a369 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddExperienceOrbPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/spawn/ClientboundAddExperienceOrbPacket.java @@ -33,4 +33,9 @@ public class ClientboundAddExperienceOrbPacket implements MinecraftPacket { out.writeDouble(this.z); out.writeShort(this.exp); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerClosePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerClosePacket.java index 191773df..d8fe55b5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerClosePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerClosePacket.java @@ -21,4 +21,9 @@ public class ClientboundContainerClosePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 bcfc7609..4955e0a2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetContentPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetContentPacket.java @@ -39,4 +39,9 @@ public class ClientboundContainerSetContentPacket implements MinecraftPacket { } helper.writeOptionalItemStack(out, this.carriedItem); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetDataPacket.java index 36f900fd..8839afed 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetDataPacket.java @@ -32,4 +32,9 @@ public class ClientboundContainerSetDataPacket implements MinecraftPacket { out.writeShort(this.rawProperty); out.writeShort(this.value); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetSlotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetSlotPacket.java index 66b99058..68700906 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetSlotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundContainerSetSlotPacket.java @@ -32,4 +32,9 @@ public class ClientboundContainerSetSlotPacket implements MinecraftPacket { out.writeShort(this.slot); helper.writeOptionalItemStack(out, this.item); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundHorseScreenOpenPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundHorseScreenOpenPacket.java index 32371832..d921f3b5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundHorseScreenOpenPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundHorseScreenOpenPacket.java @@ -27,4 +27,9 @@ public class ClientboundHorseScreenOpenPacket implements MinecraftPacket { helper.writeVarInt(out, this.inventoryColumns); out.writeInt(this.entityId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundMerchantOffersPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundMerchantOffersPacket.java index aef6a66d..cf33181c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundMerchantOffersPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundMerchantOffersPacket.java @@ -72,4 +72,9 @@ public class ClientboundMerchantOffersPacket implements MinecraftPacket { out.writeBoolean(this.regularVillager); out.writeBoolean(this.canRestock); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenBookPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenBookPacket.java index 55f5f2fe..efeced26 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenBookPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenBookPacket.java @@ -23,4 +23,9 @@ public class ClientboundOpenBookPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.hand.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenScreenPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenScreenPacket.java index 19313388..22eaa4de 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenScreenPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundOpenScreenPacket.java @@ -48,4 +48,9 @@ public class ClientboundOpenScreenPacket implements MinecraftPacket { public ClientboundOpenScreenPacket withName(String name) { return new ClientboundOpenScreenPacket(this.containerId, this.type, DefaultComponentSerializer.get().deserialize(name)); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundPlaceGhostRecipePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundPlaceGhostRecipePacket.java index 352e5511..c4ef0173 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 class ClientboundPlaceGhostRecipePacket implements MinecraftPacket { 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 76c0955b..abadbfa9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockDestructionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockDestructionPacket.java @@ -30,4 +30,9 @@ public class ClientboundBlockDestructionPacket implements MinecraftPacket { helper.writePosition(out, this.position); helper.writeBlockBreakStage(out, this.stage); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEntityDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEntityDataPacket.java index d1131712..89006523 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEntityDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEntityDataPacket.java @@ -32,4 +32,9 @@ public class ClientboundBlockEntityDataPacket implements MinecraftPacket { helper.writeBlockEntityType(out, this.type); helper.writeAnyTag(out, this.nbt); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEventPacket.java index 3d3fe915..19b2862a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockEventPacket.java @@ -115,4 +115,9 @@ public class ClientboundBlockEventPacket implements MinecraftPacket { out.writeByte(val); helper.writeVarInt(out, this.blockId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockUpdatePacket.java index 05b60eb5..62899485 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockUpdatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundBlockUpdatePacket.java @@ -24,4 +24,9 @@ public class ClientboundBlockUpdatePacket implements MinecraftPacket { helper.writePosition(out, this.entry.getPosition()); helper.writeVarInt(out, this.entry.getBlock()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundChunksBiomesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundChunksBiomesPacket.java index 6d5a8757..f0096085 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundChunksBiomesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundChunksBiomesPacket.java @@ -29,4 +29,9 @@ public class ClientboundChunksBiomesPacket implements MinecraftPacket { helper.writeByteArray(buf, entry.getBuffer()); }); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundExplodePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundExplodePacket.java index 575359ed..bee540d5 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 class ClientboundExplodePacket implements MinecraftPacket { helper.writeVarInt(out, ((BuiltinSound) this.explosionSound).ordinal() + 1); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundForgetLevelChunkPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundForgetLevelChunkPacket.java index 9eeeb869..2be520d3 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundForgetLevelChunkPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundForgetLevelChunkPacket.java @@ -24,4 +24,9 @@ public class ClientboundForgetLevelChunkPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeLong(this.x & 0xFFFFFFFFL | (this.z & 0xFFFFFFFFL) << 32); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundGameEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundGameEventPacket.java index 5b033612..360cd891 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundGameEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundGameEventPacket.java @@ -67,4 +67,9 @@ public class ClientboundGameEventPacket implements MinecraftPacket { out.writeFloat(value); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelChunkWithLightPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelChunkWithLightPacket.java index 32f9aaf0..a8e61b25 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelChunkWithLightPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelChunkWithLightPacket.java @@ -61,4 +61,9 @@ public class ClientboundLevelChunkWithLightPacket implements MinecraftPacket { helper.writeLightUpdateData(out, this.lightData); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelEventPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelEventPacket.java index acd0eed3..03c02349 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelEventPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelEventPacket.java @@ -96,4 +96,9 @@ public class ClientboundLevelEventPacket implements MinecraftPacket { out.writeInt(value); out.writeBoolean(this.broadcast); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelParticlesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLevelParticlesPacket.java index 0f9de3cb..b200f738 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 class ClientboundLevelParticlesPacket implements MinecraftPacket { helper.writeParticleType(out, this.particle.getType()); helper.writeParticleData(out, this.particle.getType(), this.particle.getData()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLightUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLightUpdatePacket.java index 5936d1b3..0cc8e757 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLightUpdatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundLightUpdatePacket.java @@ -50,4 +50,9 @@ public class ClientboundLightUpdatePacket implements MinecraftPacket { helper.writeVarInt(out, this.z); helper.writeLightUpdateData(out, this.lightData); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundMapItemDataPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundMapItemDataPacket.java index 4837cfdb..a17e2365 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundMapItemDataPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundMapItemDataPacket.java @@ -89,4 +89,9 @@ public class ClientboundMapItemDataPacket implements MinecraftPacket { out.writeByte(0); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundOpenSignEditorPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundOpenSignEditorPacket.java index 648012a3..7aa3c71e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundOpenSignEditorPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundOpenSignEditorPacket.java @@ -26,4 +26,9 @@ public class ClientboundOpenSignEditorPacket implements MinecraftPacket { helper.writePosition(out, this.position); out.writeBoolean(this.isFrontText); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSectionBlocksUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSectionBlocksUpdatePacket.java index d086e63e..3a06ead2 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSectionBlocksUpdatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSectionBlocksUpdatePacket.java @@ -59,4 +59,9 @@ public class ClientboundSectionBlocksUpdatePacket implements MinecraftPacket { helper.writeVarLong(out, (long) entry.getBlock() << 12 | (long) position); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheCenterPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheCenterPacket.java index bf91c0a1..0ad5d3e5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheCenterPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheCenterPacket.java @@ -24,4 +24,9 @@ public class ClientboundSetChunkCacheCenterPacket implements MinecraftPacket { helper.writeVarInt(out, this.chunkX); helper.writeVarInt(out, this.chunkZ); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheRadiusPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheRadiusPacket.java index f77f6776..f62ba2b6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheRadiusPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetChunkCacheRadiusPacket.java @@ -21,4 +21,9 @@ public class ClientboundSetChunkCacheRadiusPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.viewDistance); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetDefaultSpawnPositionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetDefaultSpawnPositionPacket.java index dfce1a77..33ecbf8c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetDefaultSpawnPositionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetDefaultSpawnPositionPacket.java @@ -26,4 +26,9 @@ public class ClientboundSetDefaultSpawnPositionPacket implements MinecraftPacket helper.writePosition(out, this.position); out.writeFloat(this.angle); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetSimulationDistancePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetSimulationDistancePacket.java index 4f42d483..fae66ec7 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetSimulationDistancePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetSimulationDistancePacket.java @@ -21,4 +21,9 @@ public class ClientboundSetSimulationDistancePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.simulationDistance); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetTimePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSetTimePacket.java index bf84e1d4..fac19209 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 class ClientboundSetTimePacket implements MinecraftPacket { 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 039cf812..405773b9 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSoundPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundSoundPacket.java @@ -52,4 +52,9 @@ public class ClientboundSoundPacket implements MinecraftPacket { out.writeFloat(this.pitch); out.writeLong(this.seed); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundTagQueryPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundTagQueryPacket.java index 260cbf46..cffebe1c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundTagQueryPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/ClientboundTagQueryPacket.java @@ -26,4 +26,9 @@ public class ClientboundTagQueryPacket implements MinecraftPacket { helper.writeVarInt(out, this.transactionId); helper.writeAnyTag(out, this.nbt); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundInitializeBorderPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundInitializeBorderPacket.java index a6af2fba..2df7809f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundInitializeBorderPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundInitializeBorderPacket.java @@ -42,4 +42,9 @@ public class ClientboundInitializeBorderPacket implements MinecraftPacket { helper.writeVarInt(out, this.warningBlocks); helper.writeVarInt(out, this.warningTime); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderCenterPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderCenterPacket.java index 89d033a6..a3b995b3 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderCenterPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderCenterPacket.java @@ -24,4 +24,9 @@ public class ClientboundSetBorderCenterPacket implements MinecraftPacket { out.writeDouble(this.newCenterX); out.writeDouble(this.newCenterZ); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderLerpSizePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderLerpSizePacket.java index 722b8e4a..124e6bf6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderLerpSizePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderLerpSizePacket.java @@ -27,4 +27,9 @@ public class ClientboundSetBorderLerpSizePacket implements MinecraftPacket { out.writeDouble(this.newSize); helper.writeVarLong(out, this.lerpTime); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderSizePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderSizePacket.java index e3487bd1..b2c765c6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderSizePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderSizePacket.java @@ -21,4 +21,9 @@ public class ClientboundSetBorderSizePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeDouble(this.size); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDelayPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDelayPacket.java index c5bca0b8..525c3347 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDelayPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDelayPacket.java @@ -21,4 +21,9 @@ public class ClientboundSetBorderWarningDelayPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.warningDelay); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDistancePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDistancePacket.java index a6e5e281..1602c56b 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDistancePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/level/border/ClientboundSetBorderWarningDistancePacket.java @@ -21,4 +21,9 @@ public class ClientboundSetBorderWarningDistancePacket implements MinecraftPacke public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.warningBlocks); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundResetScorePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundResetScorePacket.java index 1769f683..4f8e728a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundResetScorePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundResetScorePacket.java @@ -27,4 +27,9 @@ public class ClientboundResetScorePacket implements MinecraftPacket { helper.writeString(out, this.owner); helper.writeNullable(out, this.objective, helper::writeString); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetDisplayObjectivePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetDisplayObjectivePacket.java index 65aec273..ad4902bc 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetDisplayObjectivePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetDisplayObjectivePacket.java @@ -26,4 +26,9 @@ public class ClientboundSetDisplayObjectivePacket implements MinecraftPacket { helper.writeVarInt(out, this.position.ordinal()); helper.writeString(out, this.name); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetObjectivePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetObjectivePacket.java index a316cb97..9906f5fc 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetObjectivePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetObjectivePacket.java @@ -83,4 +83,9 @@ public class ClientboundSetObjectivePacket implements MinecraftPacket { helper.writeNullable(out, this.numberFormat, helper::writeNumberFormat); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetPlayerTeamPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetPlayerTeamPacket.java index 4b4d1767..d15c03cf 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetPlayerTeamPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetPlayerTeamPacket.java @@ -166,4 +166,9 @@ public class ClientboundSetPlayerTeamPacket implements MinecraftPacket { } } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetScorePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetScorePacket.java index 9bd5fadd..bf6aa617 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetScorePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/scoreboard/ClientboundSetScorePacket.java @@ -49,4 +49,9 @@ public class ClientboundSetScorePacket implements MinecraftPacket { helper.writeNullable(out, this.display, helper::writeComponent); helper.writeNullable(out, this.numberFormat, helper::writeNumberFormat); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundClearTitlesPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundClearTitlesPacket.java index f5832deb..d1ee6630 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundClearTitlesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundClearTitlesPacket.java @@ -21,4 +21,9 @@ public class ClientboundClearTitlesPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeBoolean(this.resetTimes); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetActionBarTextPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetActionBarTextPacket.java index 190ffc6e..2adb5f95 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetActionBarTextPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetActionBarTextPacket.java @@ -22,4 +22,9 @@ public class ClientboundSetActionBarTextPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeComponent(out, this.text); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetSubtitleTextPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetSubtitleTextPacket.java index 220fe1f9..5c6b9de8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetSubtitleTextPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetSubtitleTextPacket.java @@ -22,4 +22,9 @@ public class ClientboundSetSubtitleTextPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeComponent(out, this.text); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitleTextPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitleTextPacket.java index 890abbe6..e5ec2fab 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitleTextPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitleTextPacket.java @@ -23,4 +23,9 @@ public class ClientboundSetTitleTextPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeComponent(out, this.text); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitlesAnimationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitlesAnimationPacket.java index d5e02bbe..341d0cc5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitlesAnimationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/title/ClientboundSetTitlesAnimationPacket.java @@ -27,4 +27,9 @@ public class ClientboundSetTitlesAnimationPacket implements MinecraftPacket { out.writeInt(this.stay); out.writeInt(this.fadeOut); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChangeDifficultyPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChangeDifficultyPacket.java index ba8790e5..74bee265 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChangeDifficultyPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChangeDifficultyPacket.java @@ -23,4 +23,9 @@ public class ServerboundChangeDifficultyPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeByte(this.difficulty.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChatSessionUpdatePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChatSessionUpdatePacket.java index c3934fee..e1c0564e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChatSessionUpdatePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundChatSessionUpdatePacket.java @@ -45,4 +45,9 @@ public class ServerboundChatSessionUpdatePacket implements MinecraftPacket { helper.writeByteArray(out, this.publicKey.getEncoded()); helper.writeByteArray(out, this.keySignature); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientCommandPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientCommandPacket.java index f13f49a7..646f797f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientCommandPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientCommandPacket.java @@ -23,4 +23,9 @@ public class ServerboundClientCommandPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.request.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundCommandSuggestionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundCommandSuggestionPacket.java index 2d004475..d39f25ba 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundCommandSuggestionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundCommandSuggestionPacket.java @@ -25,4 +25,9 @@ public class ServerboundCommandSuggestionPacket implements MinecraftPacket { helper.writeVarInt(out, this.transactionId); helper.writeString(out, this.text); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundDebugSampleSubscriptionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundDebugSampleSubscriptionPacket.java index d7781a69..780292b6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundDebugSampleSubscriptionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundDebugSampleSubscriptionPacket.java @@ -22,4 +22,9 @@ public class ServerboundDebugSampleSubscriptionPacket implements MinecraftPacket public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.debugSampleType.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundLockDifficultyPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundLockDifficultyPacket.java index 70be72a1..502eac9c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundLockDifficultyPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundLockDifficultyPacket.java @@ -21,4 +21,9 @@ public class ServerboundLockDifficultyPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeBoolean(this.locked); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerButtonClickPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerButtonClickPacket.java index 44d44441..b707e2db 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerButtonClickPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerButtonClickPacket.java @@ -24,4 +24,9 @@ public class ServerboundContainerButtonClickPacket implements MinecraftPacket { helper.writeVarInt(out, this.containerId); helper.writeVarInt(out, this.buttonId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClickPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClickPacket.java index 065957a0..34a2ce08 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClickPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClickPacket.java @@ -116,4 +116,9 @@ public class ServerboundContainerClickPacket implements MinecraftPacket { helper.writeOptionalItemStack(out, this.carriedItem); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClosePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClosePacket.java index d32e99d2..cf703db4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClosePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerClosePacket.java @@ -21,4 +21,9 @@ public class ServerboundContainerClosePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { 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 164cd111..17f3fe9f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerSlotStateChangedPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundContainerSlotStateChangedPacket.java @@ -28,4 +28,9 @@ public class ServerboundContainerSlotStateChangedPacket implements MinecraftPack helper.writeVarInt(out, this.containerId); out.writeBoolean(this.newState); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPickItemPacket.java index dd6d1b31..35d5b6a3 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 class ServerboundPickItemPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.slot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPlaceRecipePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPlaceRecipePacket.java index 5279c8e1..26c813f1 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPlaceRecipePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundPlaceRecipePacket.java @@ -28,4 +28,9 @@ public class ServerboundPlaceRecipePacket implements MinecraftPacket { helper.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 3d22b0c1..0781b189 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookChangeSettingsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookChangeSettingsPacket.java @@ -29,4 +29,9 @@ public class ServerboundRecipeBookChangeSettingsPacket implements MinecraftPacke out.writeBoolean(this.bookOpen); out.writeBoolean(this.filterActive); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookSeenRecipePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookSeenRecipePacket.java index 615a5efb..a56523f5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookSeenRecipePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRecipeBookSeenRecipePacket.java @@ -22,4 +22,9 @@ public class ServerboundRecipeBookSeenRecipePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.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 c9dbe233..dfc30953 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRenameItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundRenameItemPacket.java @@ -22,4 +22,9 @@ public class ServerboundRenameItemPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeString(out, this.name); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSeenAdvancementsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSeenAdvancementsPacket.java index f0f9a3d9..c4bcb874 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSeenAdvancementsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSeenAdvancementsPacket.java @@ -58,4 +58,9 @@ public class ServerboundSeenAdvancementsPacket implements MinecraftPacket { }; tabIdWriter.accept(this.tabId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSelectTradePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSelectTradePacket.java index e32fc3b2..d6403ab0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSelectTradePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSelectTradePacket.java @@ -21,4 +21,9 @@ public class ServerboundSelectTradePacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.slot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetBeaconPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetBeaconPacket.java index 9540a7b2..c1d01369 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetBeaconPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetBeaconPacket.java @@ -42,4 +42,9 @@ public class ServerboundSetBeaconPacket implements MinecraftPacket { helper.writeVarInt(out, this.secondaryEffect.getAsInt()); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandBlockPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandBlockPacket.java index c15cfd6d..5c010b02 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandBlockPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandBlockPacket.java @@ -57,4 +57,9 @@ public class ServerboundSetCommandBlockPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandMinecartPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandMinecartPacket.java index 8adb43e4..00916596 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandMinecartPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCommandMinecartPacket.java @@ -28,4 +28,9 @@ public class ServerboundSetCommandMinecartPacket implements MinecraftPacket { helper.writeString(out, this.command); out.writeBoolean(this.doesTrackOutput); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCreativeModeSlotPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCreativeModeSlotPacket.java index 35c5c0e6..66f7d2e4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCreativeModeSlotPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetCreativeModeSlotPacket.java @@ -26,4 +26,9 @@ public class ServerboundSetCreativeModeSlotPacket implements MinecraftPacket { out.writeShort(this.slot); helper.writeOptionalItemStack(out, this.clickedItem); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetJigsawBlockPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetJigsawBlockPacket.java index d49dc500..03c34443 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetJigsawBlockPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetJigsawBlockPacket.java @@ -45,4 +45,9 @@ public class ServerboundSetJigsawBlockPacket implements MinecraftPacket { helper.writeVarInt(out, this.selectionPriority); helper.writeVarInt(out, this.placementPriority); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetStructureBlockPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetStructureBlockPacket.java index ccbec960..30042ca0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetStructureBlockPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/inventory/ServerboundSetStructureBlockPacket.java @@ -88,4 +88,9 @@ public class ServerboundSetStructureBlockPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundAcceptTeleportationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundAcceptTeleportationPacket.java index 95cbe531..fb4657d1 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundAcceptTeleportationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundAcceptTeleportationPacket.java @@ -21,4 +21,9 @@ public class ServerboundAcceptTeleportationPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.id); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundBlockEntityTagQueryPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundBlockEntityTagQueryPacket.java index 6aa8b090..b8cf0042 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundBlockEntityTagQueryPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundBlockEntityTagQueryPacket.java @@ -26,4 +26,9 @@ public class ServerboundBlockEntityTagQueryPacket implements MinecraftPacket { helper.writeVarInt(out, this.transactionId); helper.writePosition(out, this.position); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundChunkBatchReceivedPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundChunkBatchReceivedPacket.java index 3f981a2e..6a07dbe6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundChunkBatchReceivedPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundChunkBatchReceivedPacket.java @@ -20,4 +20,9 @@ public class ServerboundChunkBatchReceivedPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeFloat(this.desiredChunksPerTick); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundEntityTagQuery.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundEntityTagQuery.java index 24160596..54399cf3 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundEntityTagQuery.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundEntityTagQuery.java @@ -24,4 +24,9 @@ public class ServerboundEntityTagQuery implements MinecraftPacket { helper.writeVarInt(out, this.transactionId); helper.writeVarInt(out, this.entityId); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundJigsawGeneratePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundJigsawGeneratePacket.java index 3febebaf..5fc4e305 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundJigsawGeneratePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundJigsawGeneratePacket.java @@ -29,4 +29,9 @@ public class ServerboundJigsawGeneratePacket implements MinecraftPacket { helper.writeVarInt(out, this.levels); out.writeBoolean(this.keepJigsaws); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundMoveVehiclePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundMoveVehiclePacket.java index 7672d0b6..a136ea4c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundMoveVehiclePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundMoveVehiclePacket.java @@ -33,4 +33,9 @@ public class ServerboundMoveVehiclePacket implements MinecraftPacket { out.writeFloat(this.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 8bacc3fa..0bb4eaf4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPaddleBoatPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPaddleBoatPacket.java @@ -24,4 +24,9 @@ public class ServerboundPaddleBoatPacket implements MinecraftPacket { out.writeBoolean(this.rightPaddleTurning); out.writeBoolean(this.leftPaddleTurning); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPlayerInputPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundPlayerInputPacket.java index e039dc8a..5c641fea 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 class ServerboundPlayerInputPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundTeleportToEntityPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundTeleportToEntityPacket.java index d45f2323..3118904a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundTeleportToEntityPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/level/ServerboundTeleportToEntityPacket.java @@ -24,4 +24,9 @@ public class ServerboundTeleportToEntityPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeUUID(out, this.target); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundInteractPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundInteractPacket.java index f95daa95..98d0b0b0 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundInteractPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundInteractPacket.java @@ -67,4 +67,9 @@ public class ServerboundInteractPacket implements MinecraftPacket { } out.writeBoolean(this.isSneaking); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundMovePlayerPosPacket.java index 087f358f..1dee645b 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 class ServerboundMovePlayerPosPacket implements MinecraftPacket { 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 63a23cc2..dfe1d083 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 class ServerboundMovePlayerPosRotPacket implements MinecraftPacket { 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 24363b8c..91aa4541 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 class ServerboundMovePlayerRotPacket implements MinecraftPacket { 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 ba51d610..4357a60e 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 class ServerboundMovePlayerStatusOnlyPacket implements MinecraftPacket { 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 2410115a..754b4fc5 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerAbilitiesPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerAbilitiesPacket.java @@ -30,4 +30,9 @@ public class ServerboundPlayerAbilitiesPacket implements MinecraftPacket { out.writeByte(flags); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerActionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerActionPacket.java index 0d308496..67abac25 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerActionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerActionPacket.java @@ -34,4 +34,9 @@ public class ServerboundPlayerActionPacket implements MinecraftPacket { out.writeByte(this.face.ordinal()); helper.writeVarInt(out, this.sequence); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerCommandPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerCommandPacket.java index 5ef559c1..00c2a2d8 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerCommandPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundPlayerCommandPacket.java @@ -33,4 +33,9 @@ public class ServerboundPlayerCommandPacket implements MinecraftPacket { helper.writeVarInt(out, this.state.ordinal()); helper.writeVarInt(out, this.jumpBoost); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSetCarriedItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSetCarriedItemPacket.java index 26a0a7cd..4dd18d9f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSetCarriedItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSetCarriedItemPacket.java @@ -21,4 +21,9 @@ public class ServerboundSetCarriedItemPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { out.writeShort(this.slot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSwingPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSwingPacket.java index 744e454e..0beaaf73 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSwingPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundSwingPacket.java @@ -23,4 +23,9 @@ public class ServerboundSwingPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.hand.ordinal()); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemOnPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemOnPacket.java index 3f330fa5..33b92eed 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 class ServerboundUseItemOnPacket implements MinecraftPacket { 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 bdf92639..19c7b9f6 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/player/ServerboundUseItemPacket.java @@ -32,4 +32,9 @@ public class ServerboundUseItemPacket implements MinecraftPacket { out.writeFloat(this.yRot); out.writeFloat(this.xRot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundGameProfilePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundGameProfilePacket.java index 37099e9b..932d3685 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 class ClientboundGameProfilePacket implements MinecraftPacket { 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 144ddaed..4ae1f019 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundHelloPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundHelloPacket.java @@ -43,9 +43,4 @@ public class ClientboundHelloPacket implements MinecraftPacket { helper.writeByteArray(out, this.challenge); out.writeBoolean(this.shouldAuthenticate); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginCompressionPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginCompressionPacket.java index 26a9fba9..33ee3410 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginCompressionPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginCompressionPacket.java @@ -21,9 +21,4 @@ public class ClientboundLoginCompressionPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, this.threshold); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginDisconnectPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginDisconnectPacket.java index 44441204..37a1b291 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginDisconnectPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/clientbound/ClientboundLoginDisconnectPacket.java @@ -32,9 +32,4 @@ public class ClientboundLoginDisconnectPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeString(out, DefaultComponentSerializer.get().serialize(reason)); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundHelloPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundHelloPacket.java index 0691788a..141834e7 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundHelloPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundHelloPacket.java @@ -27,9 +27,4 @@ public class ServerboundHelloPacket implements MinecraftPacket { helper.writeString(out, this.username); helper.writeUUID(out, this.profileId); } - - @Override - public boolean isPriority() { - return true; - } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundKeyPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundKeyPacket.java index d4337237..65415e26 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundKeyPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/login/serverbound/ServerboundKeyPacket.java @@ -45,11 +45,6 @@ public class ServerboundKeyPacket implements MinecraftPacket { helper.writeByteArray(out, this.encryptedChallenge); } - @Override - public boolean isPriority() { - return true; - } - private static byte[] runEncryption(int mode, Key key, byte[] data) { try { Cipher cipher = Cipher.getInstance(key.getAlgorithm().equals("RSA") ? "RSA/ECB/PKCS1Padding" : "AES/CFB8/NoPadding"); diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/clientbound/ClientboundPongResponsePacket.java similarity index 90% rename from protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacket.java rename to protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/clientbound/ClientboundPongResponsePacket.java index 011a36f0..ff0d8b14 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/clientbound/ClientboundPongResponsePacket.java @@ -1,4 +1,4 @@ -package org.geysermc.mcprotocollib.protocol.packet.status.clientbound; +package org.geysermc.mcprotocollib.protocol.packet.ping.clientbound; import io.netty.buffer.ByteBuf; import lombok.AllArgsConstructor; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/serverbound/ServerboundPingRequestPacket.java similarity index 90% rename from protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacket.java rename to protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/serverbound/ServerboundPingRequestPacket.java index ef9b16ba..dceb274c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ping/serverbound/ServerboundPingRequestPacket.java @@ -1,4 +1,4 @@ -package org.geysermc.mcprotocollib.protocol.packet.status.serverbound; +package org.geysermc.mcprotocollib.protocol.packet.ping.serverbound; import io.netty.buffer.ByteBuf; import lombok.AllArgsConstructor; diff --git a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacketTest.java b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacketTest.java index 52f609de..bda267ca 100644 --- a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacketTest.java +++ b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundPongResponsePacketTest.java @@ -1,6 +1,7 @@ package org.geysermc.mcprotocollib.protocol.packet.status.clientbound; import org.geysermc.mcprotocollib.protocol.packet.PacketTest; +import org.geysermc.mcprotocollib.protocol.packet.ping.clientbound.ClientboundPongResponsePacket; import org.junit.jupiter.api.BeforeEach; public class ClientboundPongResponsePacketTest extends PacketTest { diff --git a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacketTest.java b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacketTest.java index 18c87782..c8e90d38 100644 --- a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacketTest.java +++ b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/serverbound/ServerboundPingRequestPacketTest.java @@ -1,6 +1,7 @@ package org.geysermc.mcprotocollib.protocol.packet.status.serverbound; import org.geysermc.mcprotocollib.protocol.packet.PacketTest; +import org.geysermc.mcprotocollib.protocol.packet.ping.serverbound.ServerboundPingRequestPacket; import org.junit.jupiter.api.BeforeEach; public class ServerboundPingRequestPacketTest extends PacketTest { 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/5] 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 9ff4208c..9a0aeebc 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookAddPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookAddPacket.java @@ -60,6 +60,11 @@ public class ClientboundRecipeBookAddPacket implements MinecraftPacket { out.writeBoolean(this.replace); } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + public record Entry(RecipeDisplayEntry contents, boolean notification, boolean highlight) { } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookRemovePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookRemovePacket.java index 6f8f311d..38598ef4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookRemovePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookRemovePacket.java @@ -29,4 +29,9 @@ public class ClientboundRecipeBookRemovePacket implements MinecraftPacket { helper.writeVarInt(out, recipe); } } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookSettingsPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookSettingsPacket.java index 57e40587..6fc53a17 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookSettingsPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/ClientboundRecipeBookSettingsPacket.java @@ -38,6 +38,11 @@ public class ClientboundRecipeBookSettingsPacket implements MinecraftPacket { } } + @Override + public boolean shouldRunOnGameThread() { + return true; + } + private record TypeSettings(boolean open, boolean filtering) { } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityPositionSyncPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityPositionSyncPacket.java index 95d93b61..43786e1e 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityPositionSyncPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundEntityPositionSyncPacket.java @@ -41,4 +41,9 @@ public class ClientboundEntityPositionSyncPacket implements MinecraftPacket { out.writeFloat(this.xRot); out.writeBoolean(this.onGround); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveMinecartPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveMinecartPacket.java index 0c1f8e0d..4968917d 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveMinecartPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/ClientboundMoveMinecartPacket.java @@ -50,4 +50,9 @@ public class ClientboundMoveMinecartPacket implements MinecraftPacket { output.writeFloat(lerpStep.weight()); }); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerRotationPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerRotationPacket.java index b9acd631..dd467efe 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerRotationPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerRotationPacket.java @@ -24,4 +24,9 @@ public class ClientboundPlayerRotationPacket implements MinecraftPacket { out.writeFloat(this.yRot); out.writeFloat(this.xRot); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetCursorItemPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetCursorItemPacket.java index 643a1f73..220f56eb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetCursorItemPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetCursorItemPacket.java @@ -22,4 +22,9 @@ public class ClientboundSetCursorItemPacket implements MinecraftPacket { public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeOptionalItemStack(out, this.contents); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetPlayerInventoryPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetPlayerInventoryPacket.java index a7c929fc..403d1aa7 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetPlayerInventoryPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/inventory/ClientboundSetPlayerInventoryPacket.java @@ -25,4 +25,9 @@ public class ClientboundSetPlayerInventoryPacket implements MinecraftPacket { helper.writeVarInt(out, this.slot); helper.writeOptionalItemStack(out, this.contents); } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientTickEndPacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientTickEndPacket.java index 8b9381ee..ecebd1da 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientTickEndPacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/serverbound/ServerboundClientTickEndPacket.java @@ -15,4 +15,9 @@ public class ServerboundClientTickEndPacket implements MinecraftPacket { @Override public void serialize(ByteBuf out, MinecraftCodecHelper helper) { } + + @Override + public boolean shouldRunOnGameThread() { + return true; + } } 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/5] 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 53364cb3..50d679b4 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.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; @@ -76,7 +77,11 @@ public class TcpClientSession extends TcpSession { } 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; From d6d2a33b540ac7f2a27d6f025e13b6db5f0b0d29 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sat, 16 Nov 2024 13:11:48 +0100 Subject: [PATCH 4/5] Do not tick delimiter packet --- .../ingame/clientbound/ClientboundDelimiterPacket.java | 5 ----- 1 file changed, 5 deletions(-) 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 57f9feed..f99402be 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,9 +11,4 @@ public class ClientboundDelimiterPacket implements MinecraftPacket { @Override public void serialize(ByteBuf out, MinecraftCodecHelper helper) { } - - @Override - public boolean shouldRunOnGameThread() { - return true; - } } From e6acb395fb4fe15b9a9d1b52774804786104dddb Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:02:08 +0100 Subject: [PATCH 5/5] Allow server to define packet handler executor factory --- .../geysermc/mcprotocollib/network/tcp/TcpServer.java | 9 ++++++++- .../mcprotocollib/network/tcp/TcpServerSession.java | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java index 809a88c7..f8ed04fb 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java @@ -19,17 +19,24 @@ import org.slf4j.LoggerFactory; import java.net.InetSocketAddress; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; import java.util.function.Supplier; public class TcpServer extends AbstractServer { private static final TransportHelper.TransportType TRANSPORT_TYPE = TransportHelper.determineTransportMethod(); private static final Logger log = LoggerFactory.getLogger(TcpServer.class); + private final Supplier packetHandlerExecutorFactory; private EventLoopGroup group; private Channel channel; public TcpServer(String host, int port, Supplier protocol) { + this(host, port, protocol, DefaultPacketHandlerExecutor::createExecutor); + } + + public TcpServer(String host, int port, Supplier protocol, Supplier packetHandlerExecutorFactory) { super(host, port, protocol); + this.packetHandlerExecutorFactory = packetHandlerExecutorFactory; } @Override @@ -57,7 +64,7 @@ public class TcpServer extends AbstractServer { InetSocketAddress address = (InetSocketAddress) channel.remoteAddress(); PacketProtocol protocol = createPacketProtocol(); - TcpSession session = new TcpServerSession(address.getHostName(), address.getPort(), protocol, TcpServer.this); + TcpSession session = new TcpServerSession(address.getHostName(), address.getPort(), protocol, TcpServer.this, packetHandlerExecutorFactory.get()); session.getPacketProtocol().newServerSession(TcpServer.this, session); ChannelPipeline pipeline = channel.pipeline(); 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 27b64c11..5fe68a3c 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServerSession.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServerSession.java @@ -7,13 +7,14 @@ import org.geysermc.mcprotocollib.network.packet.PacketProtocol; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.Executor; public class TcpServerSession extends TcpSession { private final TcpServer server; private final PacketCodecHelper codecHelper; - public TcpServerSession(String host, int port, PacketProtocol protocol, TcpServer server) { - super(host, port, protocol, DefaultPacketHandlerExecutor.createExecutor()); + public TcpServerSession(String host, int port, PacketProtocol protocol, TcpServer server, Executor packetHandlerExecutor) { + super(host, port, protocol, packetHandlerExecutor); this.server = server; this.codecHelper = protocol.createHelper(); }