package wealth.halloween.mixin;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.render.WorldRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
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 HalloweenWeatherRenderer {
@Unique
private static final Identifier CUSTOM_RAIN = Identifier.of("halloween", "environment/rain.png");
@Unique
private static final Identifier CUSTOM_MOON_PHASES = Identifier.of("halloween", "environment/moon_phases.png");
// Рендер дождя
@Inject(method = "renderWeather", at = @At("HEAD"))
private void injectRenderWeather(MatrixStack matrices, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) {
// Устанавливаем кастомную текстуру дождя
RenderSystem.setShaderTexture(0, CUSTOM_RAIN);
}
// Рендер фаз Луны
@Inject(method = "renderSky", at = @At("HEAD"))
private void injectRenderMoon(MatrixStack matrices, float tickDelta, CallbackInfo ci) {
// Устанавливаем кастомную текстуру фаз Луны
RenderSystem.setShaderTexture(0, CUSTOM_MOON_PHASES);
}
}