As everyone has already pointed out, it is probably better just to have the textures preloaded by the clients and send the reference from the server.
However if you encounter another object that you need to send with kryonet but can’t serialize it try this:
Have the object implement Serializable
Then when you register the object with Kryonet try:
kryo.register(nameofyourobject.class, new SerializableSerializer()); // this will cause it to be seralized (inefficiently) by Java's built-in serialization
You can also try:
You will need to create an empty constructor in your object for the serializer to use.
public nameofyourobject(){} //put this in your object to be serialized
----
//Put the following where you register your classes with kryo
FieldSerializer ObjectSerializer = new FieldSerializer(kryo, nameofyourobject.class); //kryo is your kryonet object
ObjectSerializer.setCanBeNull(true); //optional - set if some of the object's parameters might be null
kryo.register(nameofyourobject.class, ObjectSerializer);
If your object has non-primitive parameters you may need to create a fieldserializer for each of these datatypes as well. This method will be much more efficient than the first since it uses Kryo’s serializer.