package pokefenn.totemic.ceremony;

import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import pokefenn.totemic.api.ceremony.CeremonyEffectContext;
import pokefenn.totemic.api.ceremony.CeremonyInstance;

public class CeremonyRain extends CeremonyInstance {
    private final boolean doRain;

    public CeremonyRain(boolean doRain) {
        this.doRain = doRain;
    }

    @Override
    public void effect(Level level, BlockPos pos, CeremonyEffectContext context) {
        if(level.isRaining() != doRain) {
            level.getLevelData().setRaining(doRain);
            level.setRainLevel(doRain ? 1.0F : 0.0F);
        }
    }
}

@@ -65,16 +65,63 @@
 ockPos;%0A
+import net.minecraft.server.level.ServerLevel;%0A
 import n
@@ -548,16 +548,56 @@
 if(level
+ instanceof ServerLevel slevel && slevel
 .isRaini
@@ -630,102 +630,226 @@
     
+s
 level.
-getLevelData().setRaining(doRain);%0A            level.setRainLevel(doRain ? 1.0F : 0.0F);
+setWeatherParameters(%0A                    doRain ? 0 : 6000, //Clear weather time%0A                    doRain ? 6000 : 0, //Rain time%0A                    doRain, //raining%0A                    false); //thundering
 %0A   

Fix rain ceremony not working correctly