Skip to content

Commit 59c9570

Browse files
committed
Merge remote-tracking branch 'upstream/master' into merge-test
2 parents f541170 + 89b0311 commit 59c9570

File tree

91 files changed

+3433
-643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+3433
-643
lines changed

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ org.gradle.user.home=D:\\GradleCacheLocal
1414
minecraft_version=1.21.10
1515
yarn_mappings=1.21.10+build.2
1616
loader_version=0.17.3
17-
loom_version=1.11-SNAPSHOT
17+
loom_version=1.12-SNAPSHOT
1818

1919
# Fabric API
20-
fabric_version=0.135.0+1.21.10
20+
fabric_version=0.137.0+1.21.10
2121

2222
# Mod Properties
23-
mod_version=v7.50.3-CevAPI-MC1.21.10
23+
mod_version=v7.51-Cevapi-MC1.21.10
2424
maven_group=net.wurstclient
2525
archives_base_name=Wurst-Client
2626
mod_loader=Fabric

src/main/java/net/wurstclient/WurstClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public enum WurstClient
5050
public static MinecraftClient MC;
5151
public static IMinecraftClient IMC;
5252

53-
public static final String VERSION = "7.50.3";
53+
public static final String VERSION = "7.51";
5454
public static final String MC_VERSION = "1.21.10";
5555

5656
private PlausibleAnalytics plausible;

src/main/java/net/wurstclient/clickgui/ClickGuiIcons.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,24 @@ public static void drawCheck(DrawContext context, float x1, float y1,
174174
RenderUtils.drawLineStrip2D(context, outlineVertices, outlineColor);
175175
}
176176

177+
public static void drawIndeterminateCheck(DrawContext context, float x1,
178+
float y1, float x2, float y2, boolean hovering, boolean grayedOut)
179+
{
180+
float xc1 = x1 + 2.5F;
181+
float xc2 = x2 - 2.5F;
182+
float yc1 = y1 + 2.5F;
183+
float yc2 = y2 - 2.5F;
184+
185+
// fill
186+
int checkColor =
187+
grayedOut ? 0xC0808080 : hovering ? 0xFF00FF00 : 0xFF00D900;
188+
RenderUtils.fill2D(context, xc1, yc1, xc2, yc2, checkColor);
189+
190+
// outline
191+
int outlineColor = 0x80101010;
192+
RenderUtils.drawBorder2D(context, xc1, yc1, xc2, yc2, outlineColor);
193+
}
194+
177195
public static void drawCross(DrawContext context, float x1, float y1,
178196
float x2, float y2, boolean hovering)
179197
{

src/main/java/net/wurstclient/clickgui/components/BlockComponent.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public final class BlockComponent extends Component
2626
{
2727
private static final ClickGui GUI = WURST.getGui();
2828
private static final TextRenderer TR = MC.textRenderer;
29-
private static final int BLOCK_WITDH = 24;
29+
private static final int BLOCK_WIDTH = 24;
3030

3131
private final BlockSetting setting;
3232

@@ -41,7 +41,7 @@ public BlockComponent(BlockSetting setting)
4141
public void handleMouseClick(double mouseX, double mouseY, int mouseButton,
4242
Click context)
4343
{
44-
if(mouseX < getX() + getWidth() - BLOCK_WITDH)
44+
if(mouseX < getX() + getWidth() - BLOCK_WIDTH)
4545
return;
4646

4747
switch(mouseButton)
@@ -62,7 +62,7 @@ public void render(DrawContext context, int mouseX, int mouseY,
6262
{
6363
int x1 = getX();
6464
int x2 = x1 + getWidth();
65-
int x3 = x2 - BLOCK_WITDH;
65+
int x3 = x2 - BLOCK_WIDTH;
6666
int y1 = getY();
6767
int y2 = y1 + getHeight();
6868

@@ -128,12 +128,12 @@ private String getBlockTooltip()
128128
@Override
129129
public int getDefaultWidth()
130130
{
131-
return TR.getWidth(setting.getName() + ":") + BLOCK_WITDH + 4;
131+
return TR.getWidth(setting.getName() + ":") + BLOCK_WIDTH + 4;
132132
}
133133

134134
@Override
135135
public int getDefaultHeight()
136136
{
137-
return BLOCK_WITDH;
137+
return BLOCK_WIDTH;
138138
}
139139
}
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/*
2+
* Copyright (c) 2014-2025 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.clickgui.components;
9+
10+
import org.lwjgl.glfw.GLFW;
11+
12+
import net.minecraft.client.font.TextRenderer;
13+
import net.minecraft.client.gui.Click;
14+
import net.minecraft.client.gui.DrawContext;
15+
import net.wurstclient.clickgui.ClickGui;
16+
import net.wurstclient.clickgui.ClickGuiIcons;
17+
import net.wurstclient.clickgui.Component;
18+
import net.wurstclient.settings.PlantTypeSetting;
19+
import net.wurstclient.util.RenderUtils;
20+
import net.wurstclient.util.text.WText;
21+
22+
public final class PlantTypeComponent extends Component
23+
{
24+
private static final ClickGui GUI = WURST.getGui();
25+
private static final TextRenderer TR = MC.textRenderer;
26+
private static final int BOX_SIZE = 11;
27+
private static final int ICON_SIZE = 24;
28+
private static final String HARVEST = "Harvest";
29+
private static final String REPLANT = "Replant";
30+
31+
private final PlantTypeSetting setting;
32+
33+
public PlantTypeComponent(PlantTypeSetting setting)
34+
{
35+
this.setting = setting;
36+
setWidth(getDefaultWidth());
37+
setHeight(getDefaultHeight());
38+
}
39+
40+
@Override
41+
public void handleMouseClick(double mouseX, double mouseY, int mouseButton,
42+
Click context)
43+
{
44+
if(mouseX < getX() + ICON_SIZE)
45+
return;
46+
47+
if(mouseY < getY() + getHeight() - BOX_SIZE)
48+
return;
49+
50+
boolean hHarvest =
51+
mouseX < getX() + ICON_SIZE + BOX_SIZE + TR.getWidth(HARVEST) + 4;
52+
53+
switch(mouseButton)
54+
{
55+
case GLFW.GLFW_MOUSE_BUTTON_LEFT:
56+
if(hHarvest)
57+
setting.toggleHarvestingEnabled();
58+
else
59+
setting.toggleReplantingEnabled();
60+
break;
61+
62+
case GLFW.GLFW_MOUSE_BUTTON_RIGHT:
63+
if(hHarvest)
64+
setting.resetHarvestingEnabled();
65+
else
66+
setting.resetReplantingEnabled();
67+
break;
68+
}
69+
}
70+
71+
@Override
72+
public void render(DrawContext context, int mouseX, int mouseY,
73+
float partialTicks)
74+
{
75+
int harvestWidth = TR.getWidth(HARVEST);
76+
77+
int x1 = getX();
78+
int x2 = x1 + getWidth();
79+
int x3 = x1 + ICON_SIZE;
80+
int x4 = x3 + BOX_SIZE;
81+
int x5 = x4 + harvestWidth + 4;
82+
int x6 = x5 + BOX_SIZE;
83+
int y1 = getY();
84+
int y2 = y1 + getHeight();
85+
int y3 = y2 - BOX_SIZE;
86+
87+
boolean hovering = isHovering(mouseX, mouseY);
88+
boolean hIcon = hovering && mouseX < x3;
89+
boolean hName = hovering && mouseX >= x3 && mouseY < y3;
90+
boolean hHarvest =
91+
hovering && mouseX >= x3 && mouseX < x5 && mouseY >= y3;
92+
boolean hReplant = hovering && mouseX >= x5 && mouseY >= y3;
93+
94+
if(hIcon)
95+
GUI.setTooltip(setting.getIcon().getName().getString());
96+
else if(hName)
97+
GUI.setTooltip(setting.getWrappedDescription(200));
98+
else if(hHarvest)
99+
GUI.setTooltip("" + WText.translated("gui.wurst.autofarm.harvest"));
100+
else if(hReplant)
101+
GUI.setTooltip("" + WText.translated("gui.wurst.autofarm.replant"));
102+
103+
// background
104+
int bgColor = getFillColor(false);
105+
context.fill(x1, y1, x2, y3, bgColor);
106+
context.fill(x1, y3, x3, y2, bgColor);
107+
context.fill(x4, y3, x5, y2, bgColor);
108+
context.fill(x6, y3, x2, y2, bgColor);
109+
110+
// icon
111+
RenderUtils.drawItem(context, setting.getIcon(), x1, y1, true);
112+
113+
// boxes
114+
context.fill(x3, y3, x4, y2, getFillColor(hHarvest));
115+
context.fill(x5, y3, x6, y2, getFillColor(hReplant));
116+
int outlineColor = RenderUtils.toIntColor(GUI.getAcColor(), 0.5F);
117+
RenderUtils.drawBorder2D(context, x3, y3, x4, y2, outlineColor);
118+
RenderUtils.drawBorder2D(context, x5, y3, x6, y2, outlineColor);
119+
120+
// checks
121+
if(setting.isHarvestingEnabled())
122+
ClickGuiIcons.drawCheck(context, x3, y3, x4, y2, hHarvest, false);
123+
if(setting.isReplantingEnabled())
124+
ClickGuiIcons.drawCheck(context, x5, y3, x6, y2, hReplant, false);
125+
126+
// text
127+
String name = setting.getName();
128+
context.drawText(TR, name, x3 + 2, y1 + 3, GUI.getTxtColor(), false);
129+
context.drawText(TR, HARVEST, x4 + 2, y3 + 2, GUI.getTxtColor(), false);
130+
context.drawText(TR, REPLANT, x6 + 2, y3 + 2, GUI.getTxtColor(), false);
131+
}
132+
133+
private int getFillColor(boolean hovering)
134+
{
135+
float opacity = GUI.getOpacity() * (hovering ? 1.5F : 1);
136+
return RenderUtils.toIntColor(GUI.getBgColor(), opacity);
137+
}
138+
139+
@Override
140+
public int getDefaultWidth()
141+
{
142+
int nameWidth = TR.getWidth(setting.getName());
143+
int boxesWidth =
144+
2 * BOX_SIZE + TR.getWidth(HARVEST) + TR.getWidth(REPLANT) + 6;
145+
return ICON_SIZE + Math.max(nameWidth, boxesWidth);
146+
}
147+
148+
@Override
149+
public int getDefaultHeight()
150+
{
151+
return ICON_SIZE;
152+
}
153+
}

src/main/java/net/wurstclient/clickgui/components/RadarComponent.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import net.minecraft.entity.passive.AnimalEntity;
1919
import net.minecraft.entity.passive.WaterAnimalEntity;
2020
import net.minecraft.entity.player.PlayerEntity;
21+
import net.minecraft.util.math.MathHelper;
2122
import net.minecraft.util.math.Vec3d;
2223
import net.wurstclient.clickgui.ClickGui;
2324
import net.wurstclient.clickgui.ClickGuiIcons;
@@ -65,9 +66,9 @@ public void render(DrawContext context, int mouseX, int mouseY,
6566
matrixStack.translate(middleX, middleY);
6667

6768
ClientPlayerEntity player = MC.player;
68-
// if(!hack.isRotateEnabled()) FIXME
69-
// matrixStack.multiply(new Quaternionf().rotationZ(
70-
// (180 + player.getYaw()) * MathHelper.RADIANS_PER_DEGREE));
69+
if(!hack.isRotateEnabled())
70+
matrixStack.rotate(
71+
(180 + player.getYaw()) * MathHelper.RADIANS_PER_DEGREE);
7172

7273
// arrow
7374
ClickGuiIcons.drawRadarArrow(context, -2, -2, 2, 2);

0 commit comments

Comments
 (0)