@@ -83,15 +83,24 @@ private static boolean includeFabricChannels(ICommonPacketListener listener, Ide
83
83
return original .call (listener , location ) || NeoNetworkRegistrar .hasCodecFor (listener .getPhase (), listener .getSide () == NetworkSide .SERVERBOUND ? NetworkSide .CLIENTBOUND : NetworkSide .SERVERBOUND , location );
84
84
}
85
85
86
- @ ModifyVariable (method = "initializeNeoForgeConnection" , at = @ At (value = "INVOKE" , target = "Lnet/neoforged/neoforge/network/registration/NetworkPayloadSetup;from(Ljava/util/Map;)Lnet/neoforged/neoforge/network/registration/NetworkPayloadSetup;" ), ordinal = 1 )
86
+ @ ModifyVariable (method = "initializeNeoForgeConnection(Lnet/minecraft/network/listener/ServerConfigurationPacketListener;Ljava/util/Map;)V " , at = @ At (value = "INVOKE" , target = "Lnet/neoforged/neoforge/network/registration/NetworkPayloadSetup;from(Ljava/util/Map;)Lnet/neoforged/neoforge/network/registration/NetworkPayloadSetup;" ), ordinal = 1 )
87
87
private static Map <NetworkPhase , NegotiationResult > preserveSendableChannels (Map <NetworkPhase , NegotiationResult > results , ServerConfigurationPacketListener listener , Map <NetworkPhase , Set <ModdedNetworkQueryComponent >> clientChannels ) {
88
- Set <ModdedNetworkQueryComponent > channels = clientChannels .get (NetworkPhase .PLAY );
89
- if (channels != null && !channels .isEmpty ()) {
88
+ Set <ModdedNetworkQueryComponent > configChannels = clientChannels .get (NetworkPhase .CONFIGURATION );
89
+ if (configChannels != null && !configChannels .isEmpty ()) {
90
+ NegotiationResult negotiation = results .get (NetworkPhase .CONFIGURATION );
91
+ List <NegotiatedNetworkComponent > components = new ArrayList <>(negotiation .components ());
92
+ configChannels .stream ()
93
+ .filter (c -> components .stream ().noneMatch (d -> c .id ().equals (d .id ())) && PayloadTypeRegistryImpl .CONFIGURATION_S2C .get (c .id ()) != null )
94
+ .forEach (c -> components .add (new NegotiatedNetworkComponent (c .id (), c .version ())));
95
+ results .put (NetworkPhase .CONFIGURATION , new NegotiationResult (components , negotiation .success (), negotiation .failureReasons ()));
96
+ }
97
+ Set <ModdedNetworkQueryComponent > playChannels = clientChannels .get (NetworkPhase .PLAY );
98
+ if (playChannels != null && !playChannels .isEmpty ()) {
90
99
NegotiationResult negotiation = results .get (NetworkPhase .PLAY );
91
100
List <NegotiatedNetworkComponent > components = new ArrayList <>(negotiation .components ());
92
- channels .stream ()
93
- .filter (c -> components .stream ().noneMatch (d -> c .id ().equals (d .id ())) && PayloadTypeRegistryImpl .PLAY_S2C .get (c .id ()) != null )
94
- .forEach (c -> components .add (new NegotiatedNetworkComponent (c .id (), c .version ())));
101
+ playChannels .stream ()
102
+ .filter (c -> components .stream ().noneMatch (d -> c .id ().equals (d .id ())) && PayloadTypeRegistryImpl .PLAY_S2C .get (c .id ()) != null )
103
+ .forEach (c -> components .add (new NegotiatedNetworkComponent (c .id (), c .version ())));
95
104
results .put (NetworkPhase .PLAY , new NegotiationResult (components , negotiation .success (), negotiation .failureReasons ()));
96
105
}
97
106
return results ;
0 commit comments