diff options
author | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-10-13 22:51:23 -0700 |
---|---|---|
committer | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-10-13 22:51:23 -0700 |
commit | 407a3cfabed3869b38527153e8b3322a824f1263 (patch) | |
tree | 06909dc024d048e999354a0c7102a57bccf32ef8 /src/main/java/com/anthonyhilyard/iceberg/util/GuiHelper.java | |
parent | 0eb0e8504684ad9e7bdae99a54de618809cee8d4 (diff) | |
download | Iceberg-407a3cfabed3869b38527153e8b3322a824f1263.tar.gz Iceberg-407a3cfabed3869b38527153e8b3322a824f1263.tar.bz2 Iceberg-407a3cfabed3869b38527153e8b3322a824f1263.zip |
Initial commit for 1.17.1 version.
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/util/GuiHelper.java')
-rw-r--r-- | src/main/java/com/anthonyhilyard/iceberg/util/GuiHelper.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/util/GuiHelper.java b/src/main/java/com/anthonyhilyard/iceberg/util/GuiHelper.java index 4325ebe..b87c057 100644 --- a/src/main/java/com/anthonyhilyard/iceberg/util/GuiHelper.java +++ b/src/main/java/com/anthonyhilyard/iceberg/util/GuiHelper.java @@ -1,15 +1,15 @@ package com.anthonyhilyard.iceberg.util; -import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; -import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.client.renderer.GameRenderer; +import com.mojang.blaze3d.vertex.Tesselator; +import com.mojang.blaze3d.vertex.BufferBuilder; +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import com.mojang.blaze3d.vertex.VertexFormat; +import com.mojang.math.Matrix4f; public class GuiHelper { - @SuppressWarnings("deprecation") public static void drawGradientRectHorizontal(Matrix4f mat, int zLevel, int left, int top, int right, int bottom, int startColor, int endColor) { float startAlpha = (float)(startColor >> 24 & 255) / 255.0F; @@ -25,18 +25,17 @@ public class GuiHelper RenderSystem.disableTexture(); RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); - RenderSystem.shadeModel(GL11.GL_SMOOTH); + RenderSystem.setShader(GameRenderer::getPositionColorShader); - Tessellator tessellator = Tessellator.getInstance(); + Tesselator tessellator = Tesselator.getInstance(); BufferBuilder buffer = tessellator.getBuilder(); - buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); + buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR); buffer.vertex(mat, right, top, zLevel).color( endRed, endGreen, endBlue, endAlpha).endVertex(); buffer.vertex(mat, left, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex(); buffer.vertex(mat, left, bottom, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex(); buffer.vertex(mat, right, bottom, zLevel).color( endRed, endGreen, endBlue, endAlpha).endVertex(); tessellator.end(); - RenderSystem.shadeModel(GL11.GL_FLAT); RenderSystem.disableBlend(); RenderSystem.enableTexture(); } |