2525
2626package org .visuals .legacy .animatium .util .rendering ;
2727
28- import net .minecraft .core .BlockPos ;
2928import net .minecraft .util .Mth ;
3029import net .minecraft .world .entity .Entity ;
31- import net . minecraft . world . level . LevelReader ;
30+ import org . visuals . legacy . animatium . util . Utils ;
3231
3332public final class LegacyFogDarkness {
3433 public static final LegacyFogDarkness INSTANCE = new LegacyFogDarkness ();
@@ -41,17 +40,10 @@ public final class LegacyFogDarkness {
4140
4241 public void tick (final Entity entity , final int viewDistance ) {
4342 this .prevDarkness = this .darkness ;
44- this .darkness = Mth .lerp (0.1F , this .darkness , Mth .lerp (this .getBrightness (entity ), viewDistance / 32.0F , 1.0F ));
43+ this .darkness = Mth .lerp (0.1F , this .darkness , Mth .lerp (Utils .getBrightness (entity ), viewDistance / 32.0F , 1.0F ));
4544 }
4645
4746 public float getDarkness (final float tickDelta ) {
4847 return Mth .lerp (tickDelta , this .prevDarkness , this .darkness );
4948 }
50-
51- private float getBrightness (final Entity entity ) {
52- final LevelReader reader = entity .level ();
53- final BlockPos blockPos = entity .blockPosition ();
54- final float amount = reader .getMaxLocalRawBrightness (blockPos ) / 15.0F ;
55- return Mth .lerp (reader .dimensionType ().ambientLight (), amount / (4.0F - 3.0F * amount ), 1.0F );
56- }
5749}
0 commit comments