diff --git a/build.gradle b/build.gradle index 4406eed47..f8589e316 100644 --- a/build.gradle +++ b/build.gradle @@ -498,7 +498,7 @@ curseforge { id = "306612" changelog = ENV.CHANGELOG ?: "No changelog provided" releaseType = project.prerelease == "true" ? "beta" : "release" - addGameVersion "1.19.1" + addGameVersion "1.19.2" addGameVersion "Fabric" mainArtifact(signingEnabled ? signRemapJar.output : remapJar) { diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/PacketSender.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/PacketSender.java index bb765f9a1..ecdbb7421 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/PacketSender.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/PacketSender.java @@ -23,9 +23,9 @@ import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; import org.jetbrains.annotations.Nullable; -import net.minecraft.class_7648; import net.minecraft.network.Packet; import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.PacketCallbacks; import net.minecraft.util.Identifier; import net.fabricmc.fabric.impl.networking.GenericFutureListenerHolder; @@ -64,7 +64,7 @@ public interface PacketSender { * @param packet the packet * @param callback an optional callback to execute after the packet is sent, may be {@code null}. The callback may also accept a {@link ChannelFutureListener}. */ - void sendPacket(Packet<?> packet, @Nullable class_7648 callback); + void sendPacket(Packet<?> packet, @Nullable PacketCallbacks callback); /** * Sends a packet to a channel. @@ -98,7 +98,7 @@ public interface PacketSender { * @param buf the content of the packet * @param callback an optional callback to execute after the packet is sent, may be {@code null} */ - default void sendPacket(Identifier channel, PacketByteBuf buf, @Nullable class_7648 callback) { + default void sendPacket(Identifier channel, PacketByteBuf buf, @Nullable PacketCallbacks callback) { Objects.requireNonNull(channel, "Channel cannot be null"); Objects.requireNonNull(buf, "Payload cannot be null"); diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/AbstractChanneledNetworkAddon.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/AbstractChanneledNetworkAddon.java index 477b9f4fe..c64a2d30c 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/AbstractChanneledNetworkAddon.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/AbstractChanneledNetworkAddon.java @@ -30,10 +30,10 @@ import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; import org.jetbrains.annotations.Nullable; -import net.minecraft.class_7648; import net.minecraft.network.ClientConnection; import net.minecraft.network.Packet; import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.PacketCallbacks; import net.minecraft.util.Identifier; import net.minecraft.util.InvalidIdentifierException; @@ -182,7 +182,7 @@ public abstract class AbstractChanneledNetworkAddon<H> extends AbstractNetworkAd } @Override - public void sendPacket(Packet<?> packet, class_7648 callback) { + public void sendPacket(Packet<?> packet, PacketCallbacks callback) { Objects.requireNonNull(packet, "Packet cannot be null"); this.connection.send(packet, callback); diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/GenericFutureListenerHolder.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/GenericFutureListenerHolder.java index df5bc42d8..3231f979c 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/GenericFutureListenerHolder.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/GenericFutureListenerHolder.java @@ -22,15 +22,15 @@ import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; import org.jetbrains.annotations.Nullable; -import net.minecraft.class_7648; import net.minecraft.network.ClientConnection; import net.minecraft.network.Packet; +import net.minecraft.network.PacketCallbacks; /** - * We still need to support {@link GenericFutureListener} so we use this disguise impl {@link class_7648} + * We still need to support {@link GenericFutureListener} so we use this disguise impl {@link PacketCallbacks} * to get our {@link GenericFutureListener} to into {@link ClientConnection}. */ -public final class GenericFutureListenerHolder implements class_7648 { +public final class GenericFutureListenerHolder implements PacketCallbacks { private final GenericFutureListener<? extends Future<? super Void>> delegate; private GenericFutureListenerHolder(GenericFutureListener<? extends Future<? super Void>> delegate) { @@ -51,13 +51,13 @@ public final class GenericFutureListenerHolder implements class_7648 { } @Override - public void method_45083() { + public void onSuccess() { throw new AssertionError("Should not be called"); } @Nullable @Override - public Packet<?> method_45086() { + public Packet<?> getFailurePacket() { throw new AssertionError("Should not be called"); } } diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerLoginNetworkAddon.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerLoginNetworkAddon.java index 26be0becf..9f13ea221 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerLoginNetworkAddon.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerLoginNetworkAddon.java @@ -29,10 +29,10 @@ import java.util.concurrent.atomic.AtomicReference; import io.netty.util.concurrent.GenericFutureListener; import org.jetbrains.annotations.Nullable; -import net.minecraft.class_7648; import net.minecraft.network.ClientConnection; import net.minecraft.network.Packet; import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.PacketCallbacks; import net.minecraft.network.packet.c2s.login.LoginQueryResponseC2SPacket; import net.minecraft.network.packet.s2c.login.LoginCompressionS2CPacket; import net.minecraft.network.packet.s2c.login.LoginQueryRequestS2CPacket; @@ -116,7 +116,7 @@ public final class ServerLoginNetworkAddon extends AbstractNetworkAddon<ServerLo // Compression is not needed for local transport if (this.server.getNetworkCompressionThreshold() >= 0 && !this.connection.isLocal()) { this.connection.send(new LoginCompressionS2CPacket(this.server.getNetworkCompressionThreshold()), - class_7648.method_45084(() -> connection.setCompressionThreshold(server.getNetworkCompressionThreshold(), true)) + PacketCallbacks.always(() -> connection.setCompressionThreshold(server.getNetworkCompressionThreshold(), true)) ); } } @@ -181,7 +181,7 @@ public final class ServerLoginNetworkAddon extends AbstractNetworkAddon<ServerLo } @Override - public void sendPacket(Packet<?> packet, class_7648 callback) { + public void sendPacket(Packet<?> packet, PacketCallbacks callback) { Objects.requireNonNull(packet, "Packet cannot be null"); this.connection.send(packet, callback); diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ClientConnectionMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ClientConnectionMixin.java index 72b2cf97c..c6fa4eef6 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ClientConnectionMixin.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ClientConnectionMixin.java @@ -33,11 +33,11 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -import net.minecraft.class_7648; import net.minecraft.network.ClientConnection; import net.minecraft.network.NetworkSide; import net.minecraft.network.NetworkState; import net.minecraft.network.Packet; +import net.minecraft.network.PacketCallbacks; import net.minecraft.network.listener.PacketListener; import net.minecraft.text.Text; import net.minecraft.util.Identifier; @@ -57,7 +57,7 @@ abstract class ClientConnectionMixin implements ChannelInfoHolder { public abstract void disconnect(Text disconnectReason); @Shadow - public abstract void send(Packet<?> packet, @Nullable class_7648 arg); + public abstract void send(Packet<?> packet, @Nullable PacketCallbacks arg); @Unique private Collection<Identifier> playChannels; @@ -68,8 +68,8 @@ abstract class ClientConnectionMixin implements ChannelInfoHolder { } // Must be fully qualified due to mixin not working in production without it - @Redirect(method = "exceptionCaught", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;send(Lnet/minecraft/network/Packet;Lnet/minecraft/class_7648;)V")) - private void resendOnExceptionCaught(ClientConnection self, Packet<?> packet, class_7648 listener, ChannelHandlerContext context, Throwable ex) { + @Redirect(method = "exceptionCaught", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;send(Lnet/minecraft/network/Packet;Lnet/minecraft/network/PacketCallbacks;)V")) + private void resendOnExceptionCaught(ClientConnection self, Packet<?> packet, PacketCallbacks listener, ChannelHandlerContext context, Throwable ex) { PacketListener handler = this.packetListener; Text disconnectMessage = Text.translatable("disconnect.genericReason", "Internal Exception: " + ex); @@ -81,7 +81,7 @@ abstract class ClientConnectionMixin implements ChannelInfoHolder { } @Inject(method = "sendImmediately", at = @At(value = "FIELD", target = "Lnet/minecraft/network/ClientConnection;packetsSentCounter:I")) - private void checkPacket(Packet<?> packet, class_7648 callback, CallbackInfo ci) { + private void checkPacket(Packet<?> packet, PacketCallbacks callback, CallbackInfo ci) { if (this.packetListener instanceof PacketCallbackListener) { ((PacketCallbackListener) this.packetListener).sent(packet); } @@ -95,7 +95,7 @@ abstract class ClientConnectionMixin implements ChannelInfoHolder { } @Inject(method = "sendInternal", at = @At(value = "INVOKE_ASSIGN", target = "Lio/netty/channel/Channel;writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;"), locals = LocalCapture.CAPTURE_FAILHARD) - private void sendInternal(Packet<?> packet, @Nullable class_7648 listener, NetworkState packetState, NetworkState currentState, CallbackInfo ci, ChannelFuture channelFuture) { + private void sendInternal(Packet<?> packet, @Nullable PacketCallbacks listener, NetworkState packetState, NetworkState currentState, CallbackInfo ci, ChannelFuture channelFuture) { if (listener instanceof GenericFutureListenerHolder holder) { channelFuture.addListener(holder.getDelegate()); channelFuture.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); diff --git a/gradle.properties b/gradle.properties index 14450667b..f72d11f02 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ org.gradle.jvmargs=-Xmx2560M org.gradle.parallel=true -version=0.58.5 -minecraft_version=1.19.1 +version=0.58.6 +minecraft_version=1.19.2 yarn_version=+build.1 loader_version=0.14.8 @@ -16,10 +16,10 @@ fabric-blockrenderlayer-v1-version=1.1.18 fabric-command-api-v1-version=1.2.9 fabric-command-api-v2-version=2.1.5 fabric-commands-v0-version=0.2.26 -fabric-containers-v0-version=0.1.31 +fabric-containers-v0-version=0.1.32 fabric-content-registries-v0-version=3.2.1 fabric-crash-report-info-v1-version=0.2.3 -fabric-data-generation-api-v1-version=5.1.5 +fabric-data-generation-api-v1-version=5.1.6 fabric-dimensions-v1-version=2.1.28 fabric-entity-events-v1-version=1.4.16 fabric-events-interaction-v0-version=0.4.26 @@ -36,11 +36,11 @@ fabric-loot-tables-v1-version=1.1.4 fabric-message-api-v1-version=5.0.1 fabric-mining-level-api-v1-version=2.1.11 fabric-models-v0-version=0.3.15 -fabric-networking-api-v1-version=1.2.1 -fabric-networking-v0-version=0.3.18 +fabric-networking-api-v1-version=1.2.2 +fabric-networking-v0-version=0.3.19 fabric-object-builder-api-v1-version=4.0.8 fabric-particles-v1-version=1.0.8 -fabric-registry-sync-v0-version=0.9.21 +fabric-registry-sync-v0-version=0.9.22 fabric-renderer-api-v1-version=1.0.8 fabric-renderer-indigo-version=0.6.10 fabric-renderer-registries-v1-version=3.2.18 @@ -51,7 +51,7 @@ fabric-rendering-v1-version=1.10.14 fabric-resource-conditions-api-v1-version=2.0.9 fabric-resource-loader-v0-version=0.5.6 fabric-screen-api-v1-version=1.0.24 -fabric-screen-handler-api-v1-version=1.2.10 +fabric-screen-handler-api-v1-version=1.2.11 fabric-textures-v0-version=1.0.18 fabric-transfer-api-v1-version=2.0.9 fabric-transitive-access-wideners-v1-version=1.1.1