Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed syntax of vertex, color, uv, and others for 1.21.1 port #4766

Open
wants to merge 2 commits into
base: 1.21.1-porting
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ void drawPortal(PoseStack matrices, Point point) {
int stopY = startY + 48;
Matrix4f mat = matrices.last().pose();
Matrix3f n = matrices.last().normal();
v.vertex(mat, startX, startY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU0(), sprite.getV0()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.vertex(mat, startX, stopY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU0(), sprite.getV1()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.vertex(mat, stopX, stopY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU1(), sprite.getV1()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.vertex(mat, stopX, startY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU1(), sprite.getV0()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.addVertex(mat, startX, startY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU0(), sprite.getV0()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
v.addVertex(mat, startX, stopY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU0(), sprite.getV1()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
v.addVertex(mat, stopX, stopY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU1(), sprite.getV1()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
v.addVertex(mat, stopX, startY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU1(), sprite.getV0()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
immediate.endBatch();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ private static void drawHealthBar(GuiGraphics gui, GaiaGuardianEntity currentBos
RenderSystem.setShader(CoreShaders::dopplegangerBar);
BufferBuilder builder = Tesselator.getInstance().getBuilder();
builder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX);
builder.vertex(matrix, x, y + h, 0).uv(minU, maxV).endVertex();
builder.vertex(matrix, x + w, y + h, 0).uv(maxU, maxV).endVertex();
builder.vertex(matrix, x + w, y, 0).uv(maxU, minV).endVertex();
builder.vertex(matrix, x, y, 0).uv(minU, minV).endVertex();
builder.addVertex(matrix, x, y + h, 0).setUv(minU, maxV);
builder.addVertex(matrix, x + w, y + h, 0).setUv(maxU, maxV);
builder.addVertex(matrix, x + w, y, 0).setUv(maxU, minV);
builder.addVertex(matrix, x, y, 0).setUv(minU, minV);
Tesselator.getInstance().end();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package vazkii.botania.client.core.helper;

import com.mojang.blaze3d.vertex.VertexConsumer;
import org.jetbrains.annotations.NotNull;

/**
* Dirty hack to override some vertex data in {@link RenderHelper}.
Expand All @@ -21,18 +22,23 @@ class DelegatedVertexConsumer implements VertexConsumer {
}

@Override
public VertexConsumer vertex(double x, double y, double z) {
return delegate.vertex(x, y, z);
public @NotNull VertexConsumer addVertex(float x, float y, float z) {
return delegate.addVertex(x, y, z);
}

@Override
public VertexConsumer color(int red, int green, int blue, int alpha) {
return delegate.color(red, green, blue, alpha);
public @NotNull VertexConsumer setColor(int red, int green, int blue, int alpha) {
return delegate.setColor(red, green, blue, alpha);
}

@Override
public VertexConsumer uv(float u, float v) {
return delegate.uv(u, v);
public @NotNull VertexConsumer setUv(float u, float v) {
return delegate.setUv(u, v);
}

@Override
public @NotNull VertexConsumer setUv1(int u, int v) {
return delegate.setUv1(u, v);
}

@Override
Expand All @@ -41,13 +47,13 @@ public VertexConsumer overlayCoords(int u, int v) {
}

@Override
public VertexConsumer uv2(int u, int v) {
return delegate.uv2(u, v);
public @NotNull VertexConsumer setUv2(int u, int v) {
return delegate.setUv2(u, v);
}

@Override
public VertexConsumer normal(float x, float y, float z) {
return delegate.normal(x, y, z);
public @NotNull VertexConsumer setNormal(float x, float y, float z) {
return delegate.setNormal(x, y, z);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.joml.Matrix4f;
import org.lwjgl.opengl.GL11;
Expand Down Expand Up @@ -312,12 +313,12 @@ public static void renderStar(PoseStack ms, MultiBufferSource buffers, int color
float g = ((color & 0xFF00) >> 8) / 255F;
float b = (color & 0xFF) / 255F;
Matrix4f mat = ms.last().pose();
Runnable center = () -> buffer.vertex(mat, 0, 0, 0).color(r, g, b, f1).endVertex();
Runnable center = () -> buffer.addVertex(mat, 0, 0, 0).setColor(r, g, b, f1);
Runnable[] vertices = {
() -> buffer.vertex(mat, -0.866F * f4, f3, -0.5F * f4).color(0, 0, 0, 0).endVertex(),
() -> buffer.vertex(mat, 0.866F * f4, f3, -0.5F * f4).color(0, 0, 0, 0).endVertex(),
() -> buffer.vertex(mat, 0, f3, 1F * f4).color(0, 0, 0, 0).endVertex(),
() -> buffer.vertex(mat, -0.866F * f4, f3, -0.5F * f4).color(0, 0, 0, 0).endVertex()
() -> buffer.addVertex(mat, -0.866F * f4, f3, -0.5F * f4).setColor(0, 0, 0, 0),
() -> buffer.addVertex(mat, 0.866F * f4, f3, -0.5F * f4).setColor(0, 0, 0, 0),
() -> buffer.addVertex(mat, 0, f3, 1F * f4).setColor(0, 0, 0, 0),
() -> buffer.addVertex(mat, -0.866F * f4, f3, -0.5F * f4).setColor(0, 0, 0, 0)
};
triangleFan(center, vertices);
}
Expand All @@ -344,10 +345,10 @@ public static void triangleFan(Runnable center, List<Runnable> vertices) {
public static void flatRectangle(VertexConsumer buffer, Matrix4f mat,
float xMin, float xMax, float y, float zMin, float zMax,
int r, int g, int b, int a) {
buffer.vertex(mat, xMax, y, zMin).color(r, g, b, a).endVertex();
buffer.vertex(mat, xMin, y, zMin).color(r, g, b, a).endVertex();
buffer.vertex(mat, xMin, y, zMax).color(r, g, b, a).endVertex();
buffer.vertex(mat, xMax, y, zMax).color(r, g, b, a).endVertex();
buffer.addVertex(mat, xMax, y, zMin).setColor(r, g, b, a);
buffer.addVertex(mat, xMin, y, zMin).setColor(r, g, b, a);
buffer.addVertex(mat, xMin, y, zMax).setColor(r, g, b, a);
buffer.addVertex(mat, xMax, y, zMax).setColor(r, g, b, a);
}

public static void renderProgressPie(GuiGraphics gui, int x, int y, float progress, ItemStack stack) {
Expand Down Expand Up @@ -381,14 +382,14 @@ public static void renderProgressPie(GuiGraphics gui, int x, int y, float progre
BufferBuilder buf = Tesselator.getInstance().getBuilder();
RenderSystem.setShader(GameRenderer::getPositionColorShader);
buf.begin(VertexFormat.Mode.TRIANGLE_FAN, DefaultVertexFormat.POSITION_COLOR);
buf.vertex(mat, centerX, centerY, 0).color(0, 0.5F, 0.5F, a).endVertex();
buf.addVertex(mat, centerX, centerY, 0).setColor(0, 0.5F, 0.5F, a);

for (int i = degs; i >= 0; i--) {
float rad = (i - 90) / 180F * (float) Math.PI;
buf.vertex(mat, centerX + Mth.cos(rad) * r, centerY + Mth.sin(rad) * r, 0).color(0F, 1F, 0.5F, a).endVertex();
buf.addVertex(mat, centerX + Mth.cos(rad) * r, centerY + Mth.sin(rad) * r, 0).setColor(0F, 1F, 0.5F, a);
}

buf.vertex(mat, centerX, centerY, 0).color(0F, 1F, 0.5F, a).endVertex();
buf.addVertex(mat, centerX, centerY, 0).setColor(0F, 1F, 0.5F, a);
Tesselator.getInstance().end();

RenderSystem.disableBlend();
Expand Down Expand Up @@ -445,8 +446,8 @@ private static void renderBakedItemQuads(PoseStack ms, VertexConsumer buffer, in

buffer = new DelegatedVertexConsumer(buffer) {
@Override
public VertexConsumer color(float red, float green, float blue, float alpha) {
return super.color(r, g, b, a);
public @NotNull VertexConsumer setColor(float red, float green, float blue, float alpha) {
return super.setColor(r, g, b, a);
}
};
((ItemRendererAccessor) Minecraft.getInstance().getItemRenderer())
Expand Down Expand Up @@ -476,10 +477,10 @@ public static void renderIconFullBright(
float green = ((color >> 8) & 0xFF) / 255F;
float blue = (color & 0xFF) / 255F;

buffer.vertex(mat, startX, endY, 0).color(red, green, blue, alpha).uv(icon.getU(uvStartX), icon.getV(uvEndY)).uv2(light).endVertex();
buffer.vertex(mat, endX, endY, 0).color(red, green, blue, alpha).uv(icon.getU(uvEndX), icon.getV(uvEndY)).uv2(light).endVertex();
buffer.vertex(mat, endX, startY, 0).color(red, green, blue, alpha).uv(icon.getU(uvEndX), icon.getV(uvStartY)).uv2(light).endVertex();
buffer.vertex(mat, startX, startY, 0).color(red, green, blue, alpha).uv(icon.getU(uvStartX), icon.getV(uvStartY)).uv2(light).endVertex();
buffer.addVertex(mat, startX, endY, 0).setColor(red, green, blue, alpha).setUv(icon.getU(uvStartX), icon.getV(uvEndY)).uv2(light);
buffer.addVertex(mat, endX, endY, 0).setColor(red, green, blue, alpha).setUv(icon.getU(uvEndX), icon.getV(uvEndY)).uv2(light);
buffer.addVertex(mat, endX, startY, 0).setColor(red, green, blue, alpha).setUv(icon.getU(uvEndX), icon.getV(uvStartY)).uv2(light);
buffer.addVertex(mat, startX, startY, 0).setColor(red, green, blue, alpha).setUv(icon.getU(uvStartX), icon.getV(uvStartY)).uv2(light);
}

/**
Expand Down Expand Up @@ -644,18 +645,23 @@ public static int itemWithNameWidth(Minecraft mc, ItemStack itemStack) {
// Borrowed with permission from https://github.com/XFactHD/FramedBlocks/blob/14f468810fc416b39447512810f0aa86e1012335/src/main/java/xfacthd/framedblocks/client/util/GhostVertexConsumer.java
public record GhostVertexConsumer(VertexConsumer wrapped, int alpha) implements VertexConsumer {
@Override
public VertexConsumer vertex(double x, double y, double z) {
return wrapped.vertex(x, y, z);
public @NotNull VertexConsumer addVertex(float x, float y, float z) {
return wrapped.addVertex(x, y, z);
}

@Override
public VertexConsumer color(int red, int green, int blue, int alpha) {
return wrapped.color(red, green, blue, (alpha * this.alpha) / 0xFF);
public @NotNull VertexConsumer setColor(int red, int green, int blue, int alpha) {
return wrapped.setColor(red, green, blue, (alpha * this.alpha) / 0xFF);
}

@Override
public VertexConsumer uv(float u, float v) {
return wrapped.uv(u, v);
public @NotNull VertexConsumer setUv(float u, float v) {
return wrapped.setUv(u, v);
}

@Override
public @NotNull VertexConsumer setUv1(int u, int v) {
return wrapped.setUv1(u, v);
}

@Override
Expand All @@ -664,13 +670,13 @@ public VertexConsumer overlayCoords(int u, int v) {
}

@Override
public VertexConsumer uv2(int u, int v) {
return wrapped.uv2(u, v);
public @NotNull VertexConsumer setUv2(int u, int v) {
return wrapped.setUv2(u, v);
}

@Override
public VertexConsumer normal(float x, float y, float z) {
return wrapped.normal(x, y, z);
public @NotNull VertexConsumer setNormal(float x, float y, float z) {
return wrapped.setNormal(x, y, z);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ public void render(Matrix4f matrix, VertexConsumer buffer, Timestamp timestamp)
float lifeScale = timestamp.subtract(createdTimestamp).value() / options.getLifespan();
Pair<Integer, Integer> bounds = options.getFadeFunction().getRenderBounds(renderQuads.size(), lifeScale);
for (int i = bounds.getLeft(); i < bounds.getRight(); i++) {
renderQuads.get(i).getVecs().forEach(v -> buffer.vertex(matrix, (float) v.x, (float) v.y, (float) v.z)
.color(options.getColor().x(), options.getColor().y(), options.getColor().z(), options.getColor().w())
.endVertex());
renderQuads.get(i).getVecs().forEach(v -> buffer.addVertex(matrix, (float) v.x, (float) v.y, (float) v.z)
.setColor(options.getColor().x(), options.getColor().y(), options.getColor().z(), options.getColor().w()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ public void render(GuiGraphics gui, int mouseX, int mouseY, float delta) {
int stopY = y + 48;
Matrix4f mat = matrices.last().pose();
Matrix3f n = matrices.last().normal();
v.vertex(mat, startX, startY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU0(), sprite.getV0()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.vertex(mat, startX, stopY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU0(), sprite.getV1()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.vertex(mat, stopX, stopY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU1(), sprite.getV1()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.vertex(mat, stopX, startY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU1(), sprite.getV0()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.addVertex(mat, startX, startY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU0(), sprite.getV0()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
v.addVertex(mat, startX, stopY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU0(), sprite.getV1()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
v.addVertex(mat, stopX, stopY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU1(), sprite.getV1()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
v.addVertex(mat, stopX, startY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU1(), sprite.getV0()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
immediate.endBatch();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ public void draw(@NotNull ElvenTradeRecipe recipe, @NotNull IRecipeSlotsView slo
int stopY = 73;
Matrix4f mat = matrices.last().pose();
Matrix3f n = matrices.last().normal();
v.vertex(mat, startX, startY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU0(), sprite.getV0()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.vertex(mat, startX, stopY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU0(), sprite.getV1()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.vertex(mat, stopX, stopY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU1(), sprite.getV1()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.vertex(mat, stopX, startY, 0).color(1f, 1f, 1f, 1f).uv(sprite.getU1(), sprite.getV0()).uv2(0xF000F0).normal(n, 1, 0, 0).endVertex();
v.addVertex(mat, startX, startY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU0(), sprite.getV0()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
v.addVertex(mat, startX, stopY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU0(), sprite.getV1()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
v.addVertex(mat, stopX, stopY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU1(), sprite.getV1()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
v.addVertex(mat, stopX, startY, 0).setColor(1f, 1f, 1f, 1f).setUv(sprite.getU1(), sprite.getV0()).uv2(0xF000F0).setNormal(n, 1, 0, 0);
immediate.endBatch();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public void renderIcon(PoseStack ms, MultiBufferSource buffers, TextureAtlasSpri
VertexConsumer buffer = buffers.getBuffer(Sheets.translucentItemSheet());
Matrix4f model = ms.last().pose();
Matrix3f normal = ms.last().normal();
buffer.vertex(model, x, y + height, 0).color(1, 1, 1, alpha).uv(icon.getU0(), icon.getV1()).overlayCoords(overlay).uv2(0xF000F0).normal(normal, 1, 0, 0).endVertex();
buffer.vertex(model, x + width, y + height, 0).color(1, 1, 1, alpha).uv(icon.getU1(), icon.getV1()).overlayCoords(overlay).uv2(0xF000F0).normal(normal, 1, 0, 0).endVertex();
buffer.vertex(model, x + width, y, 0).color(1, 1, 1, alpha).uv(icon.getU1(), icon.getV0()).overlayCoords(overlay).uv2(0xF000F0).normal(normal, 1, 0, 0).endVertex();
buffer.vertex(model, x, y, 0).color(1, 1, 1, alpha).uv(icon.getU0(), icon.getV0()).overlayCoords(overlay).uv2(0xF000F0).normal(normal, 1, 0, 0).endVertex();
buffer.addVertex(model, x, y + height, 0).setColor(1, 1, 1, alpha).setUv(icon.getU0(), icon.getV1()).setOverlay(overlay).uv2(0xF000F0).setNormal(normal, 1, 0, 0);
buffer.addVertex(model, x + width, y + height, 0).setColor(1, 1, 1, alpha).setUv(icon.getU1(), icon.getV1()).setOverlay(overlay).uv2(0xF000F0).setNormal(normal, 1, 0, 0);
buffer.addVertex(model, x + width, y, 0).setColor(1, 1, 1, alpha).setUv(icon.getU1(), icon.getV0()).setOverlay(overlay).uv2(0xF000F0).setNormal(normal, 1, 0, 0);
buffer.addVertex(model, x, y, 0).setColor(1, 1, 1, alpha).setUv(icon.getU0(), icon.getV0()).setOverlay(overlay).uv2(0xF000F0).setNormal(normal, 1, 0, 0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ private void renderIcon(PoseStack ms, VertexConsumer buffer, TextureAtlasSprite
float f6 = 0.25F;

Matrix4f mat = ms.last().pose();
buffer.vertex(mat, 0.0F - f5, 0.0F - f6, 0.0F).color(1F, 1F, 1F, 1F).uv(f, f3).endVertex();
buffer.vertex(mat, f4 - f5, 0.0F - f6, 0.0F).color(1F, 1F, 1F, 1F).uv(f1, f3).endVertex();
buffer.vertex(mat, f4 - f5, f4 - f6, 0.0F).color(1F, 1F, 1F, 1F).uv(f1, f2).endVertex();
buffer.vertex(mat, 0.0F - f5, f4 - f6, 0.0F).color(1F, 1F, 1F, 1F).uv(f, f2).endVertex();
buffer.addVertex(mat, 0.0F - f5, 0.0F - f6, 0.0F).setColor(1F, 1F, 1F, 1F).setUv(f, f3);
buffer.addVertex(mat, f4 - f5, 0.0F - f6, 0.0F).setColor(1F, 1F, 1F, 1F).setUv(f1, f3);
buffer.addVertex(mat, f4 - f5, f4 - f6, 0.0F).setColor(1F, 1F, 1F, 1F).setUv(f1, f2);
buffer.addVertex(mat, 0.0F - f5, f4 - f6, 0.0F).setColor(1F, 1F, 1F, 1F).setUv(f, f2);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ private void renderIcon(PoseStack ms, VertexConsumer builder, TextureAtlasSprite
Matrix4f mat = ms.last().pose();
int start = 3;
int end = 13;
builder.vertex(mat, start, end, 0).color(red, green, blue, (int) (alpha * 255F))
.uv(sprite.getU(start), sprite.getV(end)).overlayCoords(overlay).uv2(light).normal(0, 0, 1).endVertex();
builder.vertex(mat, end, end, 0).color(red, green, blue, (int) (alpha * 255F))
.uv(sprite.getU(end), sprite.getV(end)).overlayCoords(overlay).uv2(light).normal(0, 0, 1).endVertex();
builder.vertex(mat, end, start, 0).color(red, green, blue, (int) (alpha * 255F))
.uv(sprite.getU(end), sprite.getV(start)).overlayCoords(overlay).uv2(light).normal(0, 0, 1).endVertex();
builder.vertex(mat, start, start, 0).color(red, green, blue, (int) (alpha * 255F))
.uv(sprite.getU(start), sprite.getV(start)).overlayCoords(overlay).uv2(light).normal(0, 0, 1).endVertex();
builder.addVertex(mat, start, end, 0).setColor(red, green, blue, (int) (alpha * 255F))
.setUv(sprite.getU(start), sprite.getV(end)).setOverlay(overlay).uv2(light).setNormal(0, 0, 1);
builder.addVertex(mat, end, end, 0).setColor(red, green, blue, (int) (alpha * 255F))
.setUv(sprite.getU(end), sprite.getV(end)).setOverlay(overlay).uv2(light).setNormal(0, 0, 1);
builder.addVertex(mat, end, start, 0).setColor(red, green, blue, (int) (alpha * 255F))
.setUv(sprite.getU(end), sprite.getV(start)).setOverlay(overlay).uv2(light).setNormal(0, 0, 1);
builder.addVertex(mat, start, start, 0).setColor(red, green, blue, (int) (alpha * 255F))
.setUv(sprite.getU(start), sprite.getV(start)).setOverlay(overlay).uv2(light).setNormal(0, 0, 1);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,11 @@ private static void vertex(PoseStack ms, VertexConsumer buffer, int color, Direc
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = color & 0xFF;
buffer.vertex(ms.last().pose(), x, y, z).color(r, g, b, a);
buffer.addVertex(ms.last().pose(), x, y, z).setColor(r, g, b, a);
switch (dir.getAxis().getPlane()) {
case HORIZONTAL -> buffer.normal(ms.last().normal(), 0, 1, 0);
case VERTICAL -> buffer.normal(ms.last().normal(), 1, 0, 0);
case HORIZONTAL -> buffer.setNormal(ms.last(), 0, 1, 0);
case VERTICAL -> buffer.setNormal(ms.last(), 1, 0, 0);
}
buffer.endVertex();
}

private static int killNonZero(int diff) {
Expand Down
Loading