Skip to content

Commit d2900d4

Browse files
committed
Updated To Suit 1.21.11 Changes
1 parent 858c724 commit d2900d4

File tree

6 files changed

+54
-15
lines changed

6 files changed

+54
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Wurst Client v7.51.3 (MC1.21.10) - Modified by CevAPI
1+
# Wurst Client v7.51.4 (MC1.21.10) - Modified by CevAPI
22

33
![CevAPI Logo](https://i.imgur.com/kBIn9Ab.png)
44

src/main/java/net/wurstclient/hacks/ChestEspHack.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ private void renderBoxes(PoseStack matrixStack)
179179
}
180180

181181
String curDimFull = MC.level == null ? "overworld"
182-
: MC.level.dimension().identifier().toString();
182+
: MC.level.dimension().location().toString();
183183
String curDim = MC.level == null ? "overworld"
184-
: MC.level.dimension().identifier().getPath();
184+
: MC.level.dimension().location().getPath();
185185

186186
for(ChestEspGroup group : groups.allGroups)
187187
{

src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import net.minecraft.client.gui.GuiGraphics;
2323
import net.minecraft.client.gui.components.AbstractWidget;
2424
import net.minecraft.client.gui.components.Button;
25+
import net.minecraft.client.input.CharacterEvent;
2526
import net.minecraft.client.input.KeyEvent;
2627
import net.minecraft.client.input.MouseButtonEvent;
2728
import net.minecraft.client.input.MouseButtonInfo;
@@ -272,13 +273,22 @@ public void press()
272273
@Override
273274
protected void onKeyPress(KeyEvent context)
274275
{
276+
if(WurstClient.INSTANCE.getGui().handleKeyPressed(context))
277+
return;
278+
275279
int keyCode = context.key();
276280

277281
if(keyCode == GLFW.GLFW_KEY_ESCAPE
278282
|| keyCode == GLFW.GLFW_KEY_BACKSPACE)
279283
goBack();
280284
}
281285

286+
@Override
287+
protected boolean onCharTyped(CharacterEvent event)
288+
{
289+
return WurstClient.INSTANCE.getGui().handleCharTyped(event);
290+
}
291+
282292
@Override
283293
protected void onMouseClick(MouseButtonEvent context)
284294
{

src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import net.minecraft.client.gui.GuiGraphics;
1616
import net.minecraft.client.gui.components.EditBox;
1717
import net.minecraft.client.gui.screens.Screen;
18+
import net.minecraft.client.input.CharacterEvent;
1819
import net.minecraft.client.input.KeyEvent;
1920
import net.minecraft.client.input.MouseButtonEvent;
2021
import net.minecraft.network.chat.Component;
@@ -119,6 +120,15 @@ protected void onKeyPress(KeyEvent context)
119120
selectedFeature -= 3;
120121
}
121122

123+
@Override
124+
protected boolean onCharTyped(CharacterEvent event)
125+
{
126+
if(clickTimer != -1 || searchBar == null)
127+
return false;
128+
129+
return searchBar.charTyped(event);
130+
}
131+
122132
@Override
123133
protected void onMouseClick(MouseButtonEvent context)
124134
{

src/main/java/net/wurstclient/navigator/NavigatorScreen.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.awt.Rectangle;
1111
import net.minecraft.client.gui.GuiGraphics;
1212
import net.minecraft.client.gui.screens.Screen;
13+
import net.minecraft.client.input.CharacterEvent;
1314
import net.minecraft.client.input.KeyEvent;
1415
import net.minecraft.client.input.MouseButtonEvent;
1516
import net.minecraft.network.chat.Component;
@@ -48,6 +49,15 @@ public final boolean keyPressed(KeyEvent context)
4849
return super.keyPressed(context);
4950
}
5051

52+
@Override
53+
public final boolean charTyped(CharacterEvent event)
54+
{
55+
if(onCharTyped(event))
56+
return true;
57+
58+
return super.charTyped(event);
59+
}
60+
5161
@Override
5262
public final boolean mouseClicked(MouseButtonEvent context,
5363
boolean doubleClick)
@@ -198,6 +208,11 @@ public final boolean isPauseScreen()
198208

199209
protected abstract void onKeyPress(KeyEvent context);
200210

211+
protected boolean onCharTyped(CharacterEvent event)
212+
{
213+
return false;
214+
}
215+
201216
protected abstract void onMouseClick(MouseButtonEvent context);
202217

203218
protected abstract void onMouseDrag(double mouseX, double mouseY,

src/main/java/net/wurstclient/util/RenderUtils.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ private static void drawLine(PoseStack.Pose entry, VertexConsumer buffer,
318318
float lineWidth)
319319
{
320320
Vector3f normal = new Vector3f(x2, y2, z2).sub(x1, y1, z1).normalize();
321-
buffer.addVertex(entry, x1, y1, z1).setColor(color)
322-
.setNormal(entry, normal).setLineWidth(lineWidth);
321+
buffer.addVertex(entry, x1, y1, z1).setColor(color).setNormal(entry,
322+
normal);
323323

324324
// If the line goes through the screen, add another vertex there. This
325325
// works around a bug in Minecraft's line shader.
@@ -328,31 +328,35 @@ private static void drawLine(PoseStack.Pose entry, VertexConsumer buffer,
328328
if(t > 0 && t < length)
329329
{
330330
Vector3f closeToCam = new Vector3f(normal).mul(t).add(x1, y1, z1);
331-
buffer.addVertex(entry, closeToCam).setColor(color)
332-
.setNormal(entry, normal).setLineWidth(lineWidth);
333-
buffer.addVertex(entry, closeToCam).setColor(color)
334-
.setNormal(entry, normal).setLineWidth(lineWidth);
331+
buffer.addVertex(entry, closeToCam).setColor(color).setNormal(entry,
332+
normal);
333+
buffer.addVertex(entry, closeToCam).setColor(color).setNormal(entry,
334+
normal);
335335
}
336336

337-
buffer.addVertex(entry, x2, y2, z2).setColor(color)
338-
.setNormal(entry, normal).setLineWidth(lineWidth);
337+
buffer.addVertex(entry, x2, y2, z2).setColor(color).setNormal(entry,
338+
normal);
339339
}
340340

341341
public static void drawLine(VertexConsumer buffer, float x1, float y1,
342342
float z1, float x2, float y2, float z2, int color)
343343
{
344344
Vector3f n = new Vector3f(x2, y2, z2).sub(x1, y1, z1).normalize();
345-
buffer.addVertex(x1, y1, z1).setColor(color).setNormal(n.x, n.y, n.z)
346-
.setLineWidth(DEFAULT_LINE_WIDTH);
347-
buffer.addVertex(x2, y2, z2).setColor(color).setNormal(n.x, n.y, n.z)
348-
.setLineWidth(DEFAULT_LINE_WIDTH);
345+
buffer.addVertex(x1, y1, z1).setColor(color).setNormal(n.x, n.y, n.z);
346+
buffer.addVertex(x2, y2, z2).setColor(color).setNormal(n.x, n.y, n.z);
349347
}
350348

349+
public static void drawCurvedLine(PoseStack matrices, List<Vec3> points,
350+
int color, boolean depthTest)
351+
{
352+
depthTest = NiceWurstModule.enforceDepthTest(depthTest);
351353
MultiBufferSource.BufferSource vcp = getVCP();
352354
RenderType layer = WurstRenderLayers.getLineStrip(depthTest);
353355
VertexConsumer buffer = vcp.getBuffer(layer);
354356

357+
Vec3 offset = getCameraPos().reverse();
355358
List<Vec3> points2 = points.stream().map(v -> v.add(offset)).toList();
359+
356360
drawCurvedLine(matrices, buffer, points2, color);
357361

358362
vcp.endBatch(layer);

0 commit comments

Comments
 (0)