Search in sources :

Example 1 with ClientPlayNetworkAddon

use of org.quiltmc.qsl.networking.impl.client.ClientPlayNetworkAddon in project quilt-standard-libraries by QuiltMC.

the class ClientPlayNetworkHandlerMixin method initAddon.

@Inject(method = "<init>", at = @At("RETURN"))
private void initAddon(CallbackInfo ci) {
    this.addon = new ClientPlayNetworkAddon((ClientPlayNetworkHandler) (Object) this, this.client);
    // A bit of a hack but it allows the field above to be set in case someone registers handlers during INIT event which refers to said field
    ClientNetworkingImpl.setClientPlayAddon(this.addon);
    this.addon.lateInit();
}
Also used : ClientPlayNetworkAddon(org.quiltmc.qsl.networking.impl.client.ClientPlayNetworkAddon) ClientPlayNetworkHandler(net.minecraft.client.network.ClientPlayNetworkHandler) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

ClientPlayNetworkHandler (net.minecraft.client.network.ClientPlayNetworkHandler)1 ClientPlayNetworkAddon (org.quiltmc.qsl.networking.impl.client.ClientPlayNetworkAddon)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1