This commit is contained in:
modmuss 2023-08-13 16:01:02 +01:00 committed by modmuss50
parent 09816d0313
commit 96274c18fc
3 changed files with 5 additions and 4 deletions

View file

@ -14,7 +14,7 @@ jobs:
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v1
- run: ./gradlew check build publishToMavenLocal publishMods --stacktrace --warning-mode=fail -Porg.gradle.parallel.threads=4
- run: ./gradlew check build publishToMavenLocal --stacktrace --warning-mode=fail -Porg.gradle.parallel.threads=4
- uses: Juuxel/publish-checkstyle-report@v1
if: ${{ failure() }}
with:

View file

@ -95,7 +95,7 @@ abstract class ClientConnectionMixin implements ChannelInfoHolder {
}
}
@Inject(method = "sendInternal", at = @At(value = "INVOKE", target = "Lio/netty/channel/ChannelFuture;addListener(Lio/netty/util/concurrent/GenericFutureListener;)Lio/netty/channel/ChannelFuture;", remap = false), locals = LocalCapture.CAPTURE_FAILHARD)
@Inject(method = "sendInternal", at = @At(value = "INVOKE", target = "Lio/netty/channel/ChannelFuture;addListener(Lio/netty/util/concurrent/GenericFutureListener;)Lio/netty/channel/ChannelFuture;", remap = false), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
private void sendInternal(Packet<?> packet, @Nullable PacketCallbacks callbacks, boolean flush, CallbackInfo ci, ChannelFuture channelFuture) {
if (callbacks instanceof GenericFutureListenerHolder holder) {
channelFuture.addListener(holder.getDelegate());

View file

@ -47,8 +47,9 @@ public final class NetworkingPlayPacketTest implements ModInitializer {
public static final Identifier TEST_CHANNEL = NetworkingTestmods.id("test_channel");
public static void sendToTestChannel(ServerPlayerEntity player, String stuff) {
ServerPlayNetworking.send(player, new OverlayPacket(Text.literal(stuff)));
NetworkingTestmods.LOGGER.info("Sent custom payload packet in {}", TEST_CHANNEL);
ServerPlayNetworking.getSender(player).sendPacket(new OverlayPacket(Text.literal(stuff)), future -> {
NetworkingTestmods.LOGGER.info("Sent custom payload packet in {}", TEST_CHANNEL);
});
}
public static void registerCommand(CommandDispatcher<ServerCommandSource> dispatcher) {