@@ -79,7 +79,7 @@ public void registerClientboundMessageHandler(@NotNull NamespacedKey channel, @N
7979 return ;
8080 }
8181
82- ResourceLocation channelKey = new ResourceLocation (channel .namespace (), channel .key ());
82+ ResourceLocation channelKey = ResourceLocation . fromNamespaceAndPath (channel .namespace (), channel .key ());
8383 ClientPlayNetworking .registerGlobalReceiver (payloadType , (payload , context ) -> {
8484 MessageByteBuffer buffer = new MessageByteBuffer (protocol , payload .data ());
8585
@@ -111,7 +111,7 @@ public void registerServerboundMessageHandler(@NotNull NamespacedKey channel, @N
111111 return ;
112112 }
113113
114- ResourceLocation channelKey = new ResourceLocation (channel .namespace (), channel .key ());
114+ ResourceLocation channelKey = ResourceLocation . fromNamespaceAndPath (channel .namespace (), channel .key ());
115115 ServerPlayNetworking .registerGlobalReceiver (payloadType , (payload , context ) -> {
116116 MessageByteBuffer buffer = new MessageByteBuffer (protocol , payload .data ());
117117
@@ -314,7 +314,7 @@ protected S onSuccessfulServerboundMessage(@NotNull MinecraftServer server, @Not
314314 private CustomPacketPayload .Type <RawDataPayload > initTypeIfNecessary (NamespacedKey channel ) {
315315 CustomPacketPayload .Type <RawDataPayload > type = RawDataPayload .getType ();
316316 if (type == null ) {
317- RawDataPayload .setType (type = CustomPacketPayload .createType ( channel .toString ()));
317+ RawDataPayload .setType (type = new CustomPacketPayload .Type <>( ResourceLocation . parse ( channel .toString () )));
318318 }
319319 return type ;
320320 }
0 commit comments