Skip to content

Commit

Permalink
Merge branch '1.21'
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Jun 13, 2024
2 parents 2e01c02 + 9a58039 commit f7f8563
Show file tree
Hide file tree
Showing 83 changed files with 1,909 additions and 1,892 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ org.gradle.parallel=true
# Fabric Properties
# check these at https://fabricmc.net/develop/ and
# https://modrinth.com/mod/fabric-api/versions
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
minecraft_version=1.21
yarn_mappings=1.21+build.1
loader_version=0.15.11

# Fabric API
fabric_version=0.98.0+1.20.6
fabric_version=0.100.1+1.21

# Mod Properties
mod_version = v7.42-MC1.20.6
mod_version = v7.42-MC1.21
maven_group = net.wurstclient
archives_base_name = Wurst-Client

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/wurstclient/WurstClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public enum WurstClient
public static IMinecraftClient IMC;

public static final String VERSION = "7.42";
public static final String MC_VERSION = "1.20.6";
public static final String MC_VERSION = "1.21";

private WurstAnalytics analytics;
private EventManager eventManager;
Expand Down
107 changes: 53 additions & 54 deletions src/main/java/net/wurstclient/ai/PathRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.mojang.blaze3d.systems.RenderSystem;

import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.BufferRenderer;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexFormat;
Expand All @@ -27,10 +28,9 @@ public static void renderArrow(MatrixStack matrixStack, BlockPos start,
BlockPos end, RegionPos region)
{
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
RenderSystem.setShader(GameRenderer::getPositionProgram);
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES,
VertexFormats.POSITION);
BufferBuilder bufferBuilder = tessellator
.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);

int startX = start.getX() - region.x();
int startY = start.getY();
Expand All @@ -44,8 +44,8 @@ public static void renderArrow(MatrixStack matrixStack, BlockPos start,
Matrix4f matrix = matrixStack.peek().getPositionMatrix();

// main line
bufferBuilder.vertex(matrix, startX, startY, startZ).next();
bufferBuilder.vertex(matrix, endX, endY, endZ).next();
bufferBuilder.vertex(matrix, startX, startY, startZ);
bufferBuilder.vertex(matrix, endX, endY, endZ);

matrixStack.translate(endX, endY, endZ);

Expand All @@ -64,39 +64,39 @@ public static void renderArrow(MatrixStack matrixStack, BlockPos start,
matrix.rotate(zAngle, new Vector3f(0, 0, 1));

// arrow head
bufferBuilder.vertex(matrix, 0, 2, 1).next();
bufferBuilder.vertex(matrix, -1, 2, 0).next();
bufferBuilder.vertex(matrix, 0, 2, 1);
bufferBuilder.vertex(matrix, -1, 2, 0);

bufferBuilder.vertex(matrix, -1, 2, 0).next();
bufferBuilder.vertex(matrix, 0, 2, -1).next();
bufferBuilder.vertex(matrix, -1, 2, 0);
bufferBuilder.vertex(matrix, 0, 2, -1);

bufferBuilder.vertex(matrix, 0, 2, -1).next();
bufferBuilder.vertex(matrix, 1, 2, 0).next();
bufferBuilder.vertex(matrix, 0, 2, -1);
bufferBuilder.vertex(matrix, 1, 2, 0);

bufferBuilder.vertex(matrix, 1, 2, 0).next();
bufferBuilder.vertex(matrix, 0, 2, 1).next();
bufferBuilder.vertex(matrix, 1, 2, 0);
bufferBuilder.vertex(matrix, 0, 2, 1);

bufferBuilder.vertex(matrix, 1, 2, 0).next();
bufferBuilder.vertex(matrix, -1, 2, 0).next();
bufferBuilder.vertex(matrix, 1, 2, 0);
bufferBuilder.vertex(matrix, -1, 2, 0);

bufferBuilder.vertex(matrix, 0, 2, 1).next();
bufferBuilder.vertex(matrix, 0, 2, -1).next();
bufferBuilder.vertex(matrix, 0, 2, 1);
bufferBuilder.vertex(matrix, 0, 2, -1);

bufferBuilder.vertex(matrix, 0, 0, 0).next();
bufferBuilder.vertex(matrix, 1, 2, 0).next();
bufferBuilder.vertex(matrix, 0, 0, 0);
bufferBuilder.vertex(matrix, 1, 2, 0);

bufferBuilder.vertex(matrix, 0, 0, 0).next();
bufferBuilder.vertex(matrix, -1, 2, 0).next();
bufferBuilder.vertex(matrix, 0, 0, 0);
bufferBuilder.vertex(matrix, -1, 2, 0);

bufferBuilder.vertex(matrix, 0, 0, 0).next();
bufferBuilder.vertex(matrix, 0, 2, -1).next();
bufferBuilder.vertex(matrix, 0, 0, 0);
bufferBuilder.vertex(matrix, 0, 2, -1);

bufferBuilder.vertex(matrix, 0, 0, 0).next();
bufferBuilder.vertex(matrix, 0, 2, 1).next();
bufferBuilder.vertex(matrix, 0, 0, 0);
bufferBuilder.vertex(matrix, 0, 2, 1);

matrixStack.pop();

tessellator.draw();
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());
}

public static void renderNode(MatrixStack matrixStack, BlockPos pos,
Expand All @@ -110,52 +110,51 @@ public static void renderNode(MatrixStack matrixStack, BlockPos pos,

Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();

RenderSystem.setShader(GameRenderer::getPositionProgram);
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES,
VertexFormats.POSITION);
BufferBuilder bufferBuilder = tessellator
.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);

// middle part
bufferBuilder.vertex(matrix, 0, 0, 1).next();
bufferBuilder.vertex(matrix, -1, 0, 0).next();
bufferBuilder.vertex(matrix, 0, 0, 1);
bufferBuilder.vertex(matrix, -1, 0, 0);

bufferBuilder.vertex(matrix, -1, 0, 0).next();
bufferBuilder.vertex(matrix, 0, 0, -1).next();
bufferBuilder.vertex(matrix, -1, 0, 0);
bufferBuilder.vertex(matrix, 0, 0, -1);

bufferBuilder.vertex(matrix, 0, 0, -1).next();
bufferBuilder.vertex(matrix, 1, 0, 0).next();
bufferBuilder.vertex(matrix, 0, 0, -1);
bufferBuilder.vertex(matrix, 1, 0, 0);

bufferBuilder.vertex(matrix, 1, 0, 0).next();
bufferBuilder.vertex(matrix, 0, 0, 1).next();
bufferBuilder.vertex(matrix, 1, 0, 0);
bufferBuilder.vertex(matrix, 0, 0, 1);

// top part
bufferBuilder.vertex(matrix, 0, 1, 0).next();
bufferBuilder.vertex(matrix, 1, 0, 0).next();
bufferBuilder.vertex(matrix, 0, 1, 0);
bufferBuilder.vertex(matrix, 1, 0, 0);

bufferBuilder.vertex(matrix, 0, 1, 0).next();
bufferBuilder.vertex(matrix, -1, 0, 0).next();
bufferBuilder.vertex(matrix, 0, 1, 0);
bufferBuilder.vertex(matrix, -1, 0, 0);

bufferBuilder.vertex(matrix, 0, 1, 0).next();
bufferBuilder.vertex(matrix, 0, 0, -1).next();
bufferBuilder.vertex(matrix, 0, 1, 0);
bufferBuilder.vertex(matrix, 0, 0, -1);

bufferBuilder.vertex(matrix, 0, 1, 0).next();
bufferBuilder.vertex(matrix, 0, 0, 1).next();
bufferBuilder.vertex(matrix, 0, 1, 0);
bufferBuilder.vertex(matrix, 0, 0, 1);

// bottom part
bufferBuilder.vertex(matrix, 0, -1, 0).next();
bufferBuilder.vertex(matrix, 1, 0, 0).next();
bufferBuilder.vertex(matrix, 0, -1, 0);
bufferBuilder.vertex(matrix, 1, 0, 0);

bufferBuilder.vertex(matrix, 0, -1, 0).next();
bufferBuilder.vertex(matrix, -1, 0, 0).next();
bufferBuilder.vertex(matrix, 0, -1, 0);
bufferBuilder.vertex(matrix, -1, 0, 0);

bufferBuilder.vertex(matrix, 0, -1, 0).next();
bufferBuilder.vertex(matrix, 0, 0, -1).next();
bufferBuilder.vertex(matrix, 0, -1, 0);
bufferBuilder.vertex(matrix, 0, 0, -1);

bufferBuilder.vertex(matrix, 0, -1, 0).next();
bufferBuilder.vertex(matrix, 0, 0, 1).next();
bufferBuilder.vertex(matrix, 0, -1, 0);
bufferBuilder.vertex(matrix, 0, 0, 1);

tessellator.draw();
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());

matrixStack.pop();
}
Expand Down
18 changes: 7 additions & 11 deletions src/main/java/net/wurstclient/altmanager/AltRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,13 @@ private static void drawTexture(DrawContext context, int x, int y, float u,
RenderSystem.setShader(GameRenderer::getPositionTexProgram);
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix4f = matrixStack.peek().getPositionMatrix();
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
bufferBuilder.begin(VertexFormat.DrawMode.QUADS,
VertexFormats.POSITION_TEXTURE);
bufferBuilder.vertex(matrix4f, x, y, z).texture(uOverFw, vOverFh)
.next();
bufferBuilder.vertex(matrix4f, x, y2, z).texture(uOverFw, vPlusHOverFh)
.next();
bufferBuilder.vertex(matrix4f, x2, y2, z)
.texture(uPlusWOverFw, vPlusHOverFh).next();
bufferBuilder.vertex(matrix4f, x2, y, z).texture(uPlusWOverFw, vOverFh)
.next();
BufferBuilder bufferBuilder = Tessellator.getInstance()
.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE);
bufferBuilder.vertex(matrix4f, x, y, z).texture(uOverFw, vOverFh);
bufferBuilder.vertex(matrix4f, x, y2, z).texture(uOverFw, vPlusHOverFh);
bufferBuilder.vertex(matrix4f, x2, y2, z).texture(uPlusWOverFw,
vPlusHOverFh);
bufferBuilder.vertex(matrix4f, x2, y, z).texture(uPlusWOverFw, vOverFh);
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.BufferRenderer;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexFormat;
Expand Down Expand Up @@ -349,7 +350,6 @@ public void render(DrawContext context, int mouseX, int mouseY,
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
RenderSystem.setShader(GameRenderer::getPositionProgram);

// skin preview
Expand Down Expand Up @@ -384,13 +384,13 @@ public void render(DrawContext context, int mouseX, int mouseY,

RenderSystem.setShaderColor(1, 0, 0, errorTimer / 16F);

bufferBuilder.begin(VertexFormat.DrawMode.QUADS,
VertexFormats.POSITION);
bufferBuilder.vertex(matrix, 0, 0, 0).next();
bufferBuilder.vertex(matrix, width, 0, 0).next();
bufferBuilder.vertex(matrix, width, height, 0).next();
bufferBuilder.vertex(matrix, 0, height, 0).next();
tessellator.draw();
BufferBuilder bufferBuilder = tessellator
.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);
bufferBuilder.vertex(matrix, 0, 0, 0);
bufferBuilder.vertex(matrix, width, 0, 0);
bufferBuilder.vertex(matrix, width, height, 0);
bufferBuilder.vertex(matrix, 0, height, 0);
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());

GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.BufferRenderer;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexFormat;
Expand Down Expand Up @@ -422,7 +423,6 @@ public void render(DrawContext context, int mouseX, int mouseY,
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
RenderSystem.setShader(GameRenderer::getPositionProgram);

// skin preview
Expand Down Expand Up @@ -459,13 +459,13 @@ public void render(DrawContext context, int mouseX, int mouseY,

RenderSystem.setShaderColor(1, 0, 0, errorTimer / 16F);

bufferBuilder.begin(VertexFormat.DrawMode.QUADS,
VertexFormats.POSITION);
bufferBuilder.vertex(matrix, 0, 0, 0).next();
bufferBuilder.vertex(matrix, width, 0, 0).next();
bufferBuilder.vertex(matrix, width, height, 0).next();
bufferBuilder.vertex(matrix, 0, height, 0).next();
tessellator.draw();
BufferBuilder bufferBuilder = tessellator
.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);
bufferBuilder.vertex(matrix, 0, 0, 0);
bufferBuilder.vertex(matrix, width, 0, 0);
bufferBuilder.vertex(matrix, width, height, 0);
bufferBuilder.vertex(matrix, 0, height, 0);
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());

GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
Expand Down Expand Up @@ -646,7 +646,6 @@ protected void renderItem(DrawContext context, int id, int x, int y,
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
RenderSystem.setShader(GameRenderer::getPositionProgram);

// green glow when logged in
Expand All @@ -661,13 +660,13 @@ protected void renderItem(DrawContext context, int id, int x, int y,

RenderSystem.setShaderColor(0, 1, 0, opacity);

bufferBuilder.begin(VertexFormat.DrawMode.QUADS,
VertexFormats.POSITION);
bufferBuilder.vertex(matrix, x - 2, y - 2, 0).next();
bufferBuilder.vertex(matrix, x - 2 + 220, y - 2, 0).next();
bufferBuilder.vertex(matrix, x - 2 + 220, y - 2 + 30, 0).next();
bufferBuilder.vertex(matrix, x - 2, y - 2 + 30, 0).next();
tessellator.draw();
BufferBuilder bufferBuilder = tessellator
.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);
bufferBuilder.vertex(matrix, x - 2, y - 2, 0);
bufferBuilder.vertex(matrix, x - 2 + 220, y - 2, 0);
bufferBuilder.vertex(matrix, x - 2 + 220, y - 2 + 30, 0);
bufferBuilder.vertex(matrix, x - 2, y - 2 + 30, 0);
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());

GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
Expand Down
Loading

0 comments on commit f7f8563

Please sign in to comment.