Rendering for 1.21.6

This commit is contained in:
2026-03-25 15:39:41 +01:00
parent 8852856d45
commit 0f947b5115
5 changed files with 130 additions and 190 deletions
@@ -1,13 +1,13 @@
package org.saturnclient.impl.features.mixins.render; package org.saturnclient.impl.features.mixins.render;
import net.minecraft.client.render.BackgroundRenderer; import net.minecraft.client.render.fog.FogRenderer;
import org.saturnclient.mod.mods.NoFogMod; import org.saturnclient.mod.mods.NoFogMod;
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.ModifyVariable; import org.spongepowered.asm.mixin.injection.ModifyVariable;
@Mixin(BackgroundRenderer.class) @Mixin(FogRenderer.class)
public class BackgroundRendererMixin { public class BackgroundRendererMixin {
// fog // fog
@ModifyVariable(method = "applyFog", at = @At("HEAD"), ordinal = 0, argsOnly = true) @ModifyVariable(method = "applyFog", at = @At("HEAD"), ordinal = 0, argsOnly = true)
@@ -12,7 +12,6 @@ import org.saturnclient.mod.Mod;
import org.saturnclient.mod.ModLayout; import org.saturnclient.mod.ModLayout;
import org.saturnclient.mod.ModManager; import org.saturnclient.mod.ModManager;
import org.saturnclient.saturnclient.SaturnClient; import org.saturnclient.saturnclient.SaturnClient;
import org.saturnclient.saturnclient.mixin.DrawContextAccessor;
import org.saturnclient.ui.RenderScope; import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.screens.HudEditor; import org.saturnclient.ui.screens.HudEditor;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@@ -53,9 +52,7 @@ public class RenderMixin {
&& f.screen instanceof HudEditor) && f.screen instanceof HudEditor)
return; return;
RenderScope scope = new RenderScopeImpl( RenderScope scope = new RenderScopeImpl(context);
context.getMatrices(),
((DrawContextAccessor) context).getVertexConsumers());
for (Mod feature : ModManager.ENABLED_MODS) { for (Mod feature : ModManager.ENABLED_MODS) {
if (!feature.isEnabled()) if (!feature.isEnabled())
@@ -57,21 +57,21 @@ public class EntityDrawerImpl implements EntityDrawer {
renderScope.getMatrixStack().translate(vector3f.x, vector3f.y, vector3f.z); renderScope.getMatrixStack().translate(vector3f.x, vector3f.y, vector3f.z);
renderScope.getMatrixStack().multiply((QuaternionfRef) quaternionf); renderScope.getMatrixStack().multiply((QuaternionfRef) quaternionf);
renderScope.draw(); renderScope.draw();
DiffuseLighting.disableGuiDepthLighting(); // DiffuseLighting.disableGuiDepthLighting();
EntityRenderDispatcher entityRenderDispatcher = SaturnClient.client.getEntityRenderDispatcher(); EntityRenderDispatcher entityRenderDispatcher = SaturnClient.client.getEntityRenderDispatcher();
entityRenderDispatcher.setRenderShadows(false); entityRenderDispatcher.setRenderShadows(false);
if (renderScope instanceof RenderScopeImpl r) { if (renderScope instanceof RenderScopeImpl r) {
r.draw((vertexConsumers) -> { // r.draw((vertexConsumers) -> {
entityRenderDispatcher.render(entity, 0.0, 0.0, 0.0, 1.0F, // entityRenderDispatcher.render(entity, 0.0, 0.0, 0.0, 1.0F,
r.matrices, vertexConsumers, // r.matrices, vertexConsumers,
15728880); // 15728880);
}); // });
} }
renderScope.draw(); renderScope.draw();
entityRenderDispatcher.setRenderShadows(true); entityRenderDispatcher.setRenderShadows(true);
renderScope.getMatrixStack().pop(); renderScope.getMatrixStack().pop();
DiffuseLighting.enableGuiDepthLighting(); // DiffuseLighting.enableGuiDepthLighting();
} }
@Override @Override
@@ -6,9 +6,13 @@ import java.util.Objects;
import java.util.function.Consumer; import java.util.function.Consumer;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.joml.Matrix3x2f;
import org.joml.Matrix3x2fStack;
import org.joml.Matrix4f; import org.joml.Matrix4f;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.textures.GpuTextureView;
import org.saturnclient.common.provider.Providers; import org.saturnclient.common.provider.Providers;
import org.saturnclient.common.ref.asset.IdentifierRef; import org.saturnclient.common.ref.asset.IdentifierRef;
@@ -21,19 +25,18 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts; import org.saturnclient.ui.resources.Fonts;
import org.saturnclient.ui.resources.SvgTexture; import org.saturnclient.ui.resources.SvgTexture;
import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gl.RenderPipelines;
import net.minecraft.client.font.TextRenderer.TextLayerType;
import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.ScreenRect; import net.minecraft.client.gui.ScreenRect;
import net.minecraft.client.render.DiffuseLighting; import net.minecraft.client.gui.render.state.ColoredQuadGuiElementRenderState;
import net.minecraft.client.render.OverlayTexture; import net.minecraft.client.gui.render.state.GuiRenderState;
import net.minecraft.client.render.RenderLayer; import net.minecraft.client.gui.render.state.ItemGuiElementRenderState;
import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.gui.render.state.TextGuiElementRenderState;
import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.gui.render.state.TexturedQuadGuiElementRenderState;
import net.minecraft.client.render.item.ItemRenderState; import net.minecraft.client.render.item.ItemRenderState;
import net.minecraft.client.texture.GuiAtlasManager;
import net.minecraft.client.texture.Sprite; import net.minecraft.client.texture.Sprite;
import net.minecraft.client.util.Window; import net.minecraft.client.texture.TextureSetup;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemDisplayContext; import net.minecraft.item.ItemDisplayContext;
@@ -42,23 +45,25 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.crash.CrashException; import net.minecraft.util.crash.CrashException;
import net.minecraft.util.crash.CrashReport; import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.crash.CrashReportSection; import net.minecraft.util.crash.CrashReportSection;
import net.minecraft.util.math.RotationAxis;
import net.minecraft.world.World; import net.minecraft.world.World;
public class RenderScopeImpl implements RenderScope { public class RenderScopeImpl implements RenderScope {
public MatrixStack matrices; private final Matrix3x2fStack matrices;
public VertexConsumerProvider.Immediate vertexConsumers; private final GuiAtlasManager guiAtlasManager;
private ScissorStack scissorStack = new ScissorStack(); public final GuiRenderState state;
private ScissorStack scissorStack;
private int opacity = 255 << 24; private int opacity = 255 << 24;
private final ItemRenderState itemRenderState; private final ItemRenderState itemRenderState;
public RenderScopeImpl(DrawContext context) { public RenderScopeImpl(DrawContext context) {
this(context.getMatrices(), ((DrawContextAccessor) context).getVertexConsumers()); this(context.getMatrices(), ((DrawContextAccessor) (Object) context).getState());
} }
public RenderScopeImpl(MatrixStack matrices, VertexConsumerProvider.Immediate vertexConsumers) { public RenderScopeImpl(Matrix3x2fStack matrices, GuiRenderState state) {
this.state = state;
this.matrices = matrices; this.matrices = matrices;
this.vertexConsumers = vertexConsumers; this.guiAtlasManager = SaturnClient.client.getGuiAtlasManager();
this.scissorStack = new ScissorStack(); this.scissorStack = new ScissorStack();
this.itemRenderState = new ItemRenderState(); this.itemRenderState = new ItemRenderState();
} }
@@ -81,13 +86,25 @@ public class RenderScopeImpl implements RenderScope {
return (mixedAlpha << 24) | (color & 0x00FFFFFF); return (mixedAlpha << 24) | (color & 0x00FFFFFF);
} }
@Override
public void fill(int x1, int y1, int x2, int y2, int color) {
this.state.addSimpleElement(
new ColoredQuadGuiElementRenderState(RenderPipelines.GUI, TextureSetup.empty(),
new Matrix3x2f(this.matrices),
x1, y1, x2,
y2, color, color, this.scissorStack.peekLast()));
}
@Override
public void fill(int x1, int y1, int x2, int y2, int z, int color) {
this.fill(x1, y1, x2, y2, color);
}
@Override @Override
public void drawRect(int x, int y, int width, int height, int color) { public void drawRect(int x, int y, int width, int height, int color) {
if (color == 0) if (color == 0)
return; return;
color = getColor(color); color = getColor(color);
Matrix4f matrix4f = this.matrices.peek().getPositionMatrix();
int x1 = x; int x1 = x;
int x2 = x + width; int x2 = x + width;
int y1 = y; int y1 = y;
@@ -106,11 +123,7 @@ public class RenderScopeImpl implements RenderScope {
y2 = i; y2 = i;
} }
VertexConsumer vertexConsumer = this.vertexConsumers.getBuffer(RenderLayer.getGui()); this.fill(x1, y1, x2, y2, color);
vertexConsumer.vertex(matrix4f, (float) x1, (float) y1, 0).color(color);
vertexConsumer.vertex(matrix4f, (float) x1, (float) y2, 0).color(color);
vertexConsumer.vertex(matrix4f, (float) x2, (float) y2, 0).color(color);
vertexConsumer.vertex(matrix4f, (float) x2, (float) y1, 0).color(color);
} }
@Override @Override
@@ -128,15 +141,13 @@ public class RenderScopeImpl implements RenderScope {
int i = 0; int i = 0;
for (String line : text.split("\n")) { for (String line : text.split("\n")) {
color = getColor(color); color = getColor(color);
matrices.push(); this.state.addText(new TextGuiElementRenderState(SaturnClient.client.textRenderer,
matrices.translate(x, y + (i * Fonts.getHeight()), 0); ((Text) Fonts.setFont(line, font)).asOrderedText(), new Matrix3x2f(this.matrices), x, y,
matrices.scale(scale, scale, 1.0f); color, 0, false, this.scissorStack.peekLast()));
TextRenderer textRenderer = SaturnClient.client.textRenderer;
textRenderer.draw((Text) Fonts.setFont(line, font), 0, matrices.pushMatrix();
font == 0 ? 1 : 7, color, false, matrices.translate(x, y + (i * Fonts.getHeight()));
this.matrices.peek().getPositionMatrix(), matrices.scale(scale, scale);
this.vertexConsumers, TextLayerType.NORMAL, 0, 15728880);
matrices.pop();
i++; i++;
} }
} }
@@ -160,28 +171,28 @@ public class RenderScopeImpl implements RenderScope {
private void drawRoundedSide(int cornerWidth, int cornerHeight, int radius, int color) { private void drawRoundedSide(int cornerWidth, int cornerHeight, int radius, int color) {
// Top // Top
this.matrices.push(); this.matrices.pushMatrix();
this.matrices.scale(0.05f, 0.05f, 1.0f); this.matrices.scale(0.05f, 0.05f);
this.drawRoundedCorner(cornerWidth, cornerHeight, radius * 10, color); this.drawRoundedCorner(cornerWidth, cornerHeight, radius * 10, color);
this.matrices.pop(); this.matrices.popMatrix();
// Bottom // Bottom
this.matrices.push(); this.matrices.pushMatrix();
this.matrices.translate(cornerWidth, cornerHeight * 2, 0); this.matrices.translate(cornerWidth, cornerHeight * 2);
this.matrices.multiply(RotationAxis.NEGATIVE_Z.rotationDegrees(90)); this.matrices.rotate((float) Math.toRadians(90));
this.matrices.translate(0, -cornerWidth, 0); this.matrices.translate(0, -cornerWidth);
this.matrices.scale(0.05f, 0.05f, 1.0f); this.matrices.scale(0.05f, 0.05f);
this.drawRoundedCorner(cornerHeight, cornerWidth, radius * 10, color); this.drawRoundedCorner(cornerHeight, cornerWidth, radius * 10, color);
this.matrices.pop(); this.matrices.popMatrix();
} }
@Override @Override
@@ -192,21 +203,21 @@ public class RenderScopeImpl implements RenderScope {
int cornerWidth = width / 2; int cornerWidth = width / 2;
int cornerHeight = height / 2; int cornerHeight = height / 2;
this.matrices.push(); this.matrices.pushMatrix();
this.matrices.translate(x, y, 0); this.matrices.translate(x, y);
this.drawRoundedSide(cornerWidth, cornerHeight, radius, color); this.drawRoundedSide(cornerWidth, cornerHeight, radius, color);
this.matrices.translate(cornerWidth * 2, cornerHeight * 2, 0); this.matrices.translate(cornerWidth * 2, cornerHeight * 2);
this.matrices.multiply(RotationAxis.NEGATIVE_Z.rotationDegrees(180)); this.matrices.rotate((float) Math.toRadians(90));
this.matrices.translate(0, 0, 0); this.matrices.translate(0, 0);
this.drawRoundedSide(cornerWidth, cornerHeight, radius, color); this.drawRoundedSide(cornerWidth, cornerHeight, radius, color);
this.matrices.pop(); this.matrices.popMatrix();
} }
@Override @Override
@@ -270,6 +281,16 @@ public class RenderScopeImpl implements RenderScope {
private void drawTexturedQuad(Identifier sprite, int x1, int x2, int y1, int y2, float u1, float u2, float v1, private void drawTexturedQuad(Identifier sprite, int x1, int x2, int y1, int y2, float u1, float u2, float v1,
float v2, int color) { float v2, int color) {
GpuTextureView gpuTextureView = SaturnClient.client.getTextureManager().getTexture(sprite).getGlTextureView();
if (color == 0)
return;
x1 *= 4;
x2 *= 4;
y1 *= 4;
y2 *= 4;
color = getColor(color);
if (sprite.toString().endsWith(".svg")) { if (sprite.toString().endsWith(".svg")) {
sprite = (Identifier) (Object) SvgTexture.getSvg(Providers.saturn.getClient(), sprite = (Identifier) (Object) SvgTexture.getSvg(Providers.saturn.getClient(),
@@ -277,83 +298,44 @@ public class RenderScopeImpl implements RenderScope {
(x2 - x1) * 2, (y2 - y1) * 2); (x2 - x1) * 2, (y2 - y1) * 2);
} }
if (color == 0) this.state.addSimpleElement(new TexturedQuadGuiElementRenderState(RenderPipelines.GUI,
return; TextureSetup.withoutGlTexture(gpuTextureView), new Matrix3x2f(this.matrices), x1, y1, x2, y2, u1, u2,
x1 *= 4; v1, v2,
x2 *= 4; color, this.scissorStack.peekLast()));
y1 *= 4;
y2 *= 4;
color = getColor(color);
matrices.push();
matrices.scale(0.25f, 0.25f, 1.0f);
RenderLayer renderLayer = (RenderLayer) RenderLayer.getGuiTextured(sprite);
Matrix4f matrix4f = this.matrices.peek().getPositionMatrix();
VertexConsumer vertexConsumer = this.vertexConsumers.getBuffer(renderLayer);
vertexConsumer.vertex(matrix4f, (float) x1, (float) y1, 0.0F).texture(u1, v1).color(color);
vertexConsumer.vertex(matrix4f, (float) x1, (float) y2, 0.0F).texture(u1, v2).color(color);
vertexConsumer.vertex(matrix4f, (float) x2, (float) y2, 0.0F).texture(u2, v2).color(color);
vertexConsumer.vertex(matrix4f, (float) x2, (float) y1, 0.0F).texture(u2, v1).color(color);
matrices.pop();
} }
@Override @Override
public void enableScissor(int x1, int y1, int x2, int y2) { public void enableScissor(int x1, int y1, int x2, int y2) {
ScreenRect screenRect = (new ScreenRect(x1, y1, x2 - x1, y2 - y1)) ScreenRect screenRect = (new ScreenRect(x1, y1, x2 - x1, y2 - y1)).transform(this.matrices);
.transform(this.matrices.peek().getPositionMatrix()); this.scissorStack.push(screenRect);
this.setScissor(this.scissorStack.push(screenRect));
} }
@Override @Override
public void disableScissor() { public void disableScissor() {
this.setScissor(this.scissorStack.pop()); this.scissorStack.pop();
} }
@Override @Override
public boolean scissorContains(int x, int y) { public boolean scissorContains(int x, int y) {
return this.scissorStack.containsPoint(x, y); return this.scissorStack.contains(x, y);
} }
private void setScissor(@Nullable ScreenRect rect) { public static class ScissorStack {
this.draw(); private final Deque<ScreenRect> stack = new ArrayDeque();
if (rect != null) {
Window window = SaturnClient.client.getWindow(); ScissorStack() {
int i = window.getFramebufferHeight();
double d = window.getScaleFactor();
double e = (double) rect.getLeft() * d;
double f = (double) i - (double) rect.getBottom() * d;
double g = (double) rect.width() * d;
double h = (double) rect.height() * d;
RenderSystem.enableScissor((int) e, (int) f, Math.max(0, (int) g), Math.max(0, (int) h));
} else {
RenderSystem.disableScissor();
} }
} public ScreenRect push(ScreenRect rect) {
ScreenRect screenRect = (ScreenRect) this.stack.peekLast();
@Override if (screenRect != null) {
public void draw() { ScreenRect screenRect2 = (ScreenRect) Objects.requireNonNullElse(rect.intersection(screenRect),
this.vertexConsumers.draw();
}
public void draw(Consumer<VertexConsumerProvider> drawer) {
drawer.accept(this.vertexConsumers);
this.vertexConsumers.draw();
}
static class ScissorStack {
private final Deque<ScreenRect> stack = new ArrayDeque<>();
public ScreenRect push(ScreenRect p_281812_) {
ScreenRect screenrectangle = this.stack.peekLast();
if (screenrectangle != null) {
ScreenRect screenrectangle1 = Objects.requireNonNullElse(p_281812_.intersection(screenrectangle),
ScreenRect.empty()); ScreenRect.empty());
this.stack.addLast(screenrectangle1); this.stack.addLast(screenRect2);
return screenrectangle1; return screenRect2;
} else { } else {
this.stack.addLast(p_281812_); this.stack.addLast(rect);
return p_281812_; return rect;
} }
} }
@@ -363,12 +345,17 @@ public class RenderScopeImpl implements RenderScope {
throw new IllegalStateException("Scissor stack underflow"); throw new IllegalStateException("Scissor stack underflow");
} else { } else {
this.stack.removeLast(); this.stack.removeLast();
return this.stack.peekLast(); return (ScreenRect) this.stack.peekLast();
} }
} }
public boolean containsPoint(int p_329411_, int p_333404_) { @Nullable
return this.stack.isEmpty() ? true : this.stack.peek().contains(p_329411_, p_333404_); public ScreenRect peekLast() {
return (ScreenRect) this.stack.peekLast();
}
public boolean contains(int x, int y) {
return this.stack.isEmpty() ? true : ((ScreenRect) this.stack.peek()).contains(x, y);
} }
} }
@@ -405,43 +392,29 @@ public class RenderScopeImpl implements RenderScope {
private void drawItem(@Nullable LivingEntity entity, @Nullable World world, ItemStack stack, int x, int y, int seed, private void drawItem(@Nullable LivingEntity entity, @Nullable World world, ItemStack stack, int x, int y, int seed,
int z) { int z) {
if (!stack.isEmpty()) { if (!stack.isEmpty()) {
SaturnClient.client.getItemModelManager().update(this.itemRenderState, stack, ItemDisplayContext.GUI, world, entity, seed); ItemRenderState itemRenderState = new ItemRenderState();
this.matrices.push(); SaturnClient.client.getItemModelManager().clearAndUpdate(itemRenderState, stack, ItemDisplayContext.GUI,
this.matrices.translate((float) (x + 8), (float) (y + 8), world,
(float) (150 + z)); //always has depth entity, seed);
try { try {
this.matrices.scale(16.0F, -16.0F, 16.0F); this.state.addItem(new ItemGuiElementRenderState(stack.getItem().getName().toString(),
boolean bl = !this.itemRenderState.isSideLit(); new Matrix3x2f(this.matrices), itemRenderState, x, y, this.scissorStack.peekLast()));
if (bl) { } catch (Throwable throwable) {
this.draw(); CrashReport crashReport = CrashReport.create(throwable, "Rendering item");
DiffuseLighting.disableGuiDepthLighting();
}
this.itemRenderState.render(this.matrices, this.vertexConsumers, 15728880, OverlayTexture.DEFAULT_UV);
this.draw();
if (bl) {
DiffuseLighting.enableGuiDepthLighting();
}
} catch (Throwable var11) {
CrashReport crashReport = CrashReport.create(var11, "Rendering item");
CrashReportSection crashReportSection = crashReport.addElement("Item being rendered"); CrashReportSection crashReportSection = crashReport.addElement("Item being rendered");
crashReportSection.add("Item Type", () -> { crashReportSection.add("Item Type", () -> String.valueOf(stack.getItem()));
return String.valueOf(stack.getItem()); crashReportSection.add("Item Components", () -> String.valueOf(stack.getComponents()));
}); crashReportSection.add("Item Foil", () -> String.valueOf(stack.hasGlint()));
crashReportSection.add("Item Components", () -> {
return String.valueOf(stack.getComponents());
});
crashReportSection.add("Item Foil", () -> {
return String.valueOf(stack.hasGlint());
});
throw new CrashException(crashReport); throw new CrashException(crashReport);
} }
this.matrices.pop();
} }
} }
@Override
public void draw() {
}
@Override @Override
public void drawSpriteStretched(SpriteRef sprite, int x, int y, int width, int height) { public void drawSpriteStretched(SpriteRef sprite, int x, int y, int width, int height) {
this.drawSpriteStretched(sprite, x, y, width, height, -1); this.drawSpriteStretched(sprite, x, y, width, height, -1);
@@ -458,40 +431,6 @@ public class RenderScopeImpl implements RenderScope {
} }
} }
public void fill(int x1, int y1, int x2, int y2, int color) {
this.fill(x1, y1, x2, y2, 0, color);
}
public void fill(int x1, int y1, int x2, int y2, int z, int color) {
this.fill(RenderLayer.getGui(), x1, y1, x2, y2, z, color);
}
public void fill(RenderLayer layer, int x1, int y1, int x2, int y2, int color) {
this.fill(layer, x1, y1, x2, y2, 0, color);
}
public void fill(RenderLayer layer, int x1, int y1, int x2, int y2, int z, int color) {
Matrix4f matrix4f = this.matrices.peek().getPositionMatrix();
int i;
if (x1 < x2) {
i = x1;
x1 = x2;
x2 = i;
}
if (y1 < y2) {
i = y1;
y1 = y2;
y2 = i;
}
VertexConsumer vertexConsumer = this.vertexConsumers.getBuffer(layer);
vertexConsumer.vertex(matrix4f, (float) x1, (float) y1, (float) z).color(color);
vertexConsumer.vertex(matrix4f, (float) x1, (float) y2, (float) z).color(color);
vertexConsumer.vertex(matrix4f, (float) x2, (float) y2, (float) z).color(color);
vertexConsumer.vertex(matrix4f, (float) x2, (float) y1, (float) z).color(color);
}
public void drawBorder(int x, int y, int width, int height, int color) { public void drawBorder(int x, int y, int width, int height, int color) {
this.fill(x, y, x + width, y + 1, color); this.fill(x, y, x + width, y + 1, color);
this.fill(x, y + height - 1, x + width, y + height, color); this.fill(x, y + height - 1, x + width, y + height, color);
@@ -1,12 +1,16 @@
package org.saturnclient.saturnclient.mixin; package org.saturnclient.saturnclient.mixin;
import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.gui.render.state.GuiRenderState;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.Shadow;
@Mixin(DrawContext.class) @Mixin(DrawContext.class)
public interface DrawContextAccessor { public abstract class DrawContextAccessor {
@Accessor("vertexConsumers") @Shadow
VertexConsumerProvider.Immediate getVertexConsumers(); public GuiRenderState state;
public GuiRenderState getState() {
return state;
}
} }