mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-08 21:14:41 -04:00
Fix ClientConfigurationNetworkAddon.handleReady() being called too late. (#3331)
This fixes a crash when assertions are enabled. Also fixes ClientConfigurationConnectionEvents.READY being called at the incorrect time. Assertions have also been enabled for all Fabric API run configs.
This commit is contained in:
parent
b1913a6ae6
commit
74a33ae79d
2 changed files with 9 additions and 3 deletions
build.gradle
fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client
10
build.gradle
10
build.gradle
|
@ -195,6 +195,10 @@ allprojects {
|
|||
}
|
||||
}
|
||||
|
||||
loom.runs.configureEach {
|
||||
vmArg("-enableassertions")
|
||||
}
|
||||
|
||||
allprojects.each { p ->
|
||||
if (project.name == "deprecated") {
|
||||
return
|
||||
|
@ -501,7 +505,8 @@ tasks.register('runProductionAutoTestClient', JavaExec) {
|
|||
|
||||
jvmArgs(
|
||||
"-Dfabric.addMods=${remapJar.archiveFile.get().asFile.absolutePath}${File.pathSeparator}${remapTestmodJar.archiveFile.get().asFile.absolutePath}",
|
||||
"-Dfabric.autoTest"
|
||||
"-Dfabric.autoTest",
|
||||
"-enableassertions"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -532,7 +537,8 @@ tasks.register('runProductionAutoTestServer', JavaExec) {
|
|||
|
||||
jvmArgs(
|
||||
"-Dfabric.addMods=${remapJar.archiveFile.get().asFile.absolutePath}${File.pathSeparator}${remapTestmodJar.archiveFile.get().asFile.absolutePath}",
|
||||
"-Dfabric.autoTest"
|
||||
"-Dfabric.autoTest",
|
||||
"-enableassertions"
|
||||
)
|
||||
|
||||
args("nogui")
|
||||
|
|
|
@ -51,7 +51,7 @@ public abstract class ClientConfigurationNetworkHandlerMixin extends ClientCommo
|
|||
this.addon.lateInit();
|
||||
}
|
||||
|
||||
@Inject(method = "onReady", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;setPacketListener(Lnet/minecraft/network/listener/PacketListener;)V"))
|
||||
@Inject(method = "onReady", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;setPacketListener(Lnet/minecraft/network/listener/PacketListener;)V", shift = At.Shift.BEFORE))
|
||||
public void onReady(ReadyS2CPacket packet, CallbackInfo ci) {
|
||||
this.addon.handleReady();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue