package me.deftware.mixin.mixins;

import me.deftware.client.framework.event.events.EventWeather;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.WorldRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(WorldRenderer.class)
public class MixinWorldRenderer {

    @Inject(method = "method_22713", at = @At("HEAD"), cancellable = true)
    private void renderRain(Camera camera, CallbackInfo ci) {
        EventWeather event = new EventWeather(EventWeather.WeatherType.Rain);
        event.broadcast();
        if (event.isCanceled()) {
            ci.cancel();
        }
    }

}

@@ -134,16 +134,75 @@
 Camera;%0A
+import net.minecraft.client.render.LightmapTextureManager;%0A
 import n
@@ -837,10 +837,388 @@
 %0A    %7D%0A%0A
+    @Inject(method = %22renderWeather%22, at = @At(%22HEAD%22), cancellable = true)%0A    private void renderWeather(LightmapTextureManager manager, float f, double d, double e, double g, CallbackInfo ci) %7B%0A        EventWeather event = new EventWeather(EventWeather.WeatherType.Rain);%0A        event.broadcast();%0A        if (event.isCanceled()) %7B%0A            ci.cancel();%0A        %7D%0A    %7D%0A%0A
 %7D%0A

Fix EventWeather not triggering properly