Skip to content

Commit c49eb71

Browse files
committed
fix mistakes
1 parent 4dcc640 commit c49eb71

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/main/java/btw/lowercase/optiboxes/skybox/OptiFineSkyRenderer.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.mojang.blaze3d.systems.RenderSystem;
66
import com.mojang.blaze3d.vertex.*;
77
import net.minecraft.client.Minecraft;
8-
import net.minecraft.client.renderer.CoreShaders;
98
import net.minecraft.util.Mth;
109
import net.minecraft.world.level.Level;
1110
import org.joml.AxisAngle4f;
@@ -22,7 +21,7 @@ public final class OptiFineSkyRenderer {
2221
private int skyBufferIndexCount;
2322
//?} else {
2423
/*private com.mojang.blaze3d.vertex.VertexBuffer skyBuffer;
25-
*///?}
24+
*///?}
2625

2726
private OptiFineSkyRenderer() {
2827
Minecraft.getInstance().schedule(this::buildSky);
@@ -68,7 +67,7 @@ private void buildSky() {
6867
}
6968

7069
//? >=1.21.5 {
71-
private final Map<ResourceLocation, com.mojang.blaze3d.pipeline.RenderPipeline> renderPipelineCache = new HashMap<>();
70+
private final java.util.Map<net.minecraft.resources.ResourceLocation, com.mojang.blaze3d.pipeline.RenderPipeline> renderPipelineCache = new java.util.HashMap<>();
7271

7372
public static com.mojang.blaze3d.pipeline.RenderPipeline getSkyboxPipeline(@org.jetbrains.annotations.Nullable btw.lowercase.optiboxes.utils.BlendFunction blendFunction) {
7473
com.mojang.blaze3d.pipeline.RenderPipeline.Builder builder = com.mojang.blaze3d.pipeline.RenderPipeline.builder(btw.lowercase.optiboxes.mixins.RenderPipelinesAccessor.optiboxes$getMatricesProjectionSnippet());
@@ -102,7 +101,7 @@ public void renderSkybox(OptiFineSkybox optiFineSkybox, Matrix4fStack modelViewS
102101

103102
//? <=1.21.5 {
104103
/*btw.lowercase.optiboxes.utils.components.Blend.ADD.apply(1.0F - rainLevel);
105-
*///?}
104+
*///?}
106105
}
107106

108107
public void renderSkyLayer(OptiFineSkyLayer optiFineSkyLayer, Matrix4fStack modelViewStack, Level level, int timeOfDay, float skyAngle, float rainGradient, float thunderGradient, float conditionAlpha) {
@@ -123,7 +122,7 @@ public void renderSkyLayer(OptiFineSkyLayer optiFineSkyLayer, Matrix4fStack mode
123122
.build();
124123
//?} else {
125124
/*RenderSystem.setShaderTexture(0, optiFineSkyLayer.source());
126-
RenderSystem.setShader(CoreShaders.POSITION_TEX);
125+
RenderSystem.setShader(net.minecraft.client.renderer.CoreShaders.POSITION_TEX);
127126
optiFineSkyLayer.blend().apply(finalAlpha);
128127
*///?}
129128

@@ -135,6 +134,7 @@ public void renderSkyLayer(OptiFineSkyLayer optiFineSkyLayer, Matrix4fStack mode
135134
});
136135

137136
com.mojang.blaze3d.pipeline.RenderTarget renderTarget = Minecraft.getInstance().getMainRenderTarget();
137+
net.minecraft.client.renderer.texture.AbstractTexture skyTexture = Minecraft.getInstance().getTextureManager().getTexture(optiFineSkyLayer.source());
138138

139139
//? >=1.21.6 {
140140
com.mojang.blaze3d.textures.GpuTextureView texture = skyTexture.getTextureView();
@@ -146,17 +146,16 @@ public void renderSkyLayer(OptiFineSkyLayer optiFineSkyLayer, Matrix4fStack mode
146146
com.mojang.blaze3d.textures.GpuTexture depthTexture = renderTarget.getDepthTexture();
147147
*///?}
148148

149-
net.minecraft.client.renderer.texture.AbstractTexture skyTexture = Minecraft.getInstance().getTextureManager().getTexture(optiFineSkyLayer.source());
150149
com.mojang.blaze3d.buffers.GpuBuffer indexBuffer = this.skyBufferIndices.getBuffer(this.skyBufferIndexCount);
151150
try (com.mojang.blaze3d.systems.RenderPass renderPass = RenderSystem.getDevice()
152151
.createCommandEncoder()
153152
.createRenderPass(
154153
//? >=1.21.6
155154
() -> "Custom Sky Rendering",
156155
colorTexture,
157-
OptionalInt.empty(),
156+
java.util.OptionalInt.empty(),
158157
depthTexture,
159-
OptionalDouble.empty()
158+
java.util.OptionalDouble.empty()
160159
)) {
161160
renderPass.setPipeline(renderPipeline);
162161
renderPass.setVertexBuffer(0, this.skyBuffer);
@@ -197,6 +196,6 @@ private float getAngle(Level level, float skyAngle, float speed) {
197196
public void clearCache() {
198197
//? >=1.21.5 {
199198
this.renderPipelineCache.clear();
200-
//?}
199+
//?}
201200
}
202201
}

0 commit comments

Comments
 (0)