mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-22 11:56:21 +01:00
Fixup CPE snowing injection
This commit is contained in:
parent
ef6076aa07
commit
059651250e
@ -27,11 +27,21 @@ import net.minecraft.world.biome.Biome;
|
|||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(WeatherRendering.class)
|
@Mixin(WeatherRendering.class)
|
||||||
public abstract class MixinWeatherRendering {
|
public abstract class MixinWeatherRendering {
|
||||||
|
|
||||||
|
@Redirect(method = "renderPrecipitation(Lnet/minecraft/world/World;Lnet/minecraft/client/render/LightmapTextureManager;IFLnet/minecraft/util/math/Vec3d;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getRainGradient(F)F"))
|
||||||
|
private float forceSnow(World instance, float delta) {
|
||||||
|
if (CPEAdditions.isSnowing()) {
|
||||||
|
return 1F;
|
||||||
|
} else {
|
||||||
|
return instance.getRainGradient(delta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Inject(method = "getPrecipitationAt", at = @At(value = "HEAD"), cancellable = true)
|
@Inject(method = "getPrecipitationAt", at = @At(value = "HEAD"), cancellable = true)
|
||||||
private void forceSnow(World world, BlockPos pos, CallbackInfoReturnable<Biome.Precipitation> cir) {
|
private void forceSnow(World world, BlockPos pos, CallbackInfoReturnable<Biome.Precipitation> cir) {
|
||||||
if (CPEAdditions.isSnowing()) {
|
if (CPEAdditions.isSnowing()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user