Open liach opened 4 years ago
Gave it a good look through. Many of the concepts are actually quite interesting. Mainly a few questions is what this whole review consists of.
Would it make sense to overload the void respond(PacketByteBuf buf);
method into something like
default void respond(PacketByteBuf buf) {
this.respond(buf, null);
}
Similarly below with the CompletableFuture
methods as well?
Maybe have a way to check if the client's own play sender is available?
This kinda seems like internals to me. Is there any reason this is exposed? If this is needed, maybe explain what the query id corresponds to more precisely.
Maybe say @see io.github.fablabsmc.fablabs.api.networking.v1.client.ClientNetworking for networking on the client.
Or something similar if possible
Maybe move this and PacketListenerCallback to a callbacks
package to clear up a bit of the root package?
Throw a /* @Nullable */
on the method so when we got annotations in fab api we can just search and replace those comments with the annotations?
Like the case above in ClientLoginConext
, would it make sense to overload the method with no future listener to call the method with a future listener but pass null for the future.
I think there is a getClient
call or would work with just an accessor to get the MinecraftClient from the ClientLoginNetworkHandler
Similar situation like above here is possible: https://github.com/FabLabsMC/networking-api-v1-draft/blob/master/src/main/java/io/github/fablabsmc/fablabs/impl/networking/client/ClientPlayNetworkAddon.java#L119-L122
Maybe use Identifier#tryCreate
here so you can just null check
Mark this @Unique
Repeast that with any fields you add to any mixins
Icon will obviously be changed when PRed to Fabric API
@see
tag cannot include a description/*Nullable*/
sounds goodMinecraftClient.getInstance()
don't think it worthes to add an extra accessor, and in a short while don't think minecraft can have two concurrent clients at onceIdentifier.tryParse
literally just throws that exception but eats that exception message, and I want that exception message@Unique
sure, dont' think it has a potency to clash thoughSo a few changes:
/*Nullable*/
to packet receiver@Unique
to client connection fieldI'd say the @Unique
isn't just for clashes but also acts as a sort of decorator telling maintainers that you added that field.
Requesting an overall review from @i509VCB before formal submission of this draft to the fabric api.
This draft is production-ready.