3131import com .llamalad7 .mixinextras .injector .wrapoperation .Operation ;
3232import com .llamalad7 .mixinextras .injector .wrapoperation .WrapOperation ;
3333import com .mojang .blaze3d .platform .Window ;
34- import com .mojang .blaze3d .systems .RenderSystem ;
3534import com .mojang .blaze3d .vertex .DefaultVertexFormat ;
3635import com .mojang .blaze3d .vertex .PoseStack ;
3736import com .mojang .blaze3d .vertex .VertexBuffer ;
4140import net .minecraft .client .multiplayer .ClientLevel ;
4241import net .minecraft .client .renderer .*;
4342import net .minecraft .core .BlockPos ;
44- import net .minecraft .util .ARGB ;
4543import net .minecraft .world .level .BlockGetter ;
4644import net .minecraft .world .level .LevelHeightAccessor ;
4745import net .minecraft .world .level .block .state .BlockState ;
4846import net .minecraft .world .phys .shapes .CollisionContext ;
4947import net .minecraft .world .phys .shapes .VoxelShape ;
5048import org .jetbrains .annotations .Nullable ;
51- import org .joml .Matrix4fStack ;
52- import org .joml .Vector3f ;
5349import org .spongepowered .asm .mixin .Final ;
5450import org .spongepowered .asm .mixin .Mixin ;
5551import org .spongepowered .asm .mixin .Shadow ;
@@ -78,7 +74,7 @@ public abstract class MixinLevelRenderer {
7874 private void animatium$blueVoidSky (FogParameters fogParameters , DimensionSpecialEffects .SkyType skyType , float tickDelta , DimensionSpecialEffects dimensionSpecialEffects , CallbackInfo ci ) {
7975 if (AnimatiumClient .isEnabled () && AnimatiumConfig .instance ().blueVoidSky && skyType != DimensionSpecialEffects .SkyType .END && this .level != null && this .minecraft .player != null ) {
8076 int skyColor = this .level .getSkyColor (this .minecraft .gameRenderer .getMainCamera ().getPosition (), tickDelta );
81- this .animatium$renderSkyBlueVoid ( skyColor , this .minecraft .player .getEyePosition (tickDelta ).y - RenderUtils .getLevelHorizonHeight (this .level ));
77+ RenderUtils . renderBlueVoidSky ( this .level , animatium$blueVoidSkyBuffer , skyColor , this .minecraft .player .getEyePosition (tickDelta ).y - RenderUtils .getLevelHorizonHeight (this .level ));
8278 }
8379 }
8480
@@ -101,30 +97,6 @@ public abstract class MixinLevelRenderer {
10197 }
10298 }
10399
104- @ Unique
105- private void animatium$renderSkyBlueVoid (int skyColor , double depth ) {
106- assert this .level != null ;
107- Vector3f skyColorVec = ARGB .vector3fFromRGB24 (skyColor );
108- if (this .level .effects ().hasGround ()) {
109- RenderSystem .setShaderColor (skyColorVec .x * 0.2F + 0.04F , skyColorVec .y * 0.2F + 0.04F , skyColorVec .z * 0.6F + 0.1F , 1.0F );
110- } else {
111- RenderSystem .setShaderColor (skyColorVec .x , skyColorVec .y , skyColorVec .z , 1.0F );
112- }
113-
114- Matrix4fStack modelViewStack = RenderSystem .getModelViewStack ();
115- modelViewStack .pushMatrix ();
116- // TODO: AnimatiumConfig.instance().dontMoveBlueVoid
117- // if (AnimatiumClient.isEnabled() && AnimatiumConfig.instance().dontMoveBlueVoid) {
118- // modelViewStack.translate(0.0F, 12.0F, 0.0F);
119- // } else {
120- modelViewStack .translate (0.0F , -((float ) (depth - 16.0 )), 0.0F );
121- // }
122-
123- animatium$blueVoidSkyBuffer .drawWithRenderType (RenderType .sky ());
124- modelViewStack .popMatrix ();
125- RenderSystem .setShaderColor (1.0F , 1.0F , 1.0F , 1.0F );
126- }
127-
128100 @ Inject (method = "renderBlockOutline" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/renderer/LevelRenderer;renderHitOutline(Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;Lnet/minecraft/world/entity/Entity;DDDLnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;I)V" , shift = At .Shift .BEFORE ))
129101 private void animatium$setBlockOutlineWidth$on (Camera camera , MultiBufferSource .BufferSource bufferSource , PoseStack poseStack , boolean bl , CallbackInfo ci ) {
130102 if (AnimatiumClient .isEnabled () && AnimatiumConfig .instance ().blockOutlineRendering ) {
0 commit comments