Skip to content

Commit a35dcea

Browse files
Merge branch 'master' into 1.21.10
2 parents cb7921b + 84b3c91 commit a35dcea

File tree

94 files changed

+3456
-814
lines changed

Some content is hidden

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

94 files changed

+3456
-814
lines changed

.github/workflows/auto_snapshot_update.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,11 @@ jobs:
5959
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
6060
cache-read-only: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/1.') }}
6161

62-
- name: Migrate mappings for main source set
62+
- name: Migrate mappings
6363
run: |
64-
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --input "src/main/java" --output "src/main/java_"
65-
rm -rf ./src/main/java
66-
mv ./src/main/java_ ./src/main/java
67-
68-
- name: Migrate mappings for test source set
69-
run: |
70-
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --input "src/test/java" --output "src/test/java_"
71-
rm -rf ./src/test/java
72-
mv ./src/test/java_ ./src/test/java
64+
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
65+
./gradlew migrateTestMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
66+
./gradlew migrateClassTweakerMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
7367
7468
- name: Update version constants
7569
run: |

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ jobs:
9292
run: xvfb-run --auto-servernum ./gradlew runEndToEndTest --stacktrace --warning-mode=fail --no-configuration-cache
9393

9494
- name: Upload screenshots.zip artifact
95-
uses: actions/upload-artifact@v4
95+
uses: actions/upload-artifact@v5
9696
if: ${{ success() || failure() }}
9797
with:
9898
name: screenshots
9999
path: run/screenshots
100100
compression-level: 0
101101

102102
- name: Upload crash-reports.zip artifact
103-
uses: actions/upload-artifact@v4
103+
uses: actions/upload-artifact@v5
104104
if: ${{ failure() }}
105105
with:
106106
name: crash-reports

build.gradle

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ buildscript {
22
dependencies {
33
classpath "org.kohsuke:github-api:1.330"
44
}
5+
6+
configurations.classpath {
7+
resolutionStrategy {
8+
// v28.0-jre, used by fabric-loom 1.13.3, is vulnerable to CVE-2020-8908 and CVE-2023-2976
9+
force "com.google.guava:guava:32.0.1-jre"
10+
}
11+
}
512
}
613

714
plugins {
@@ -61,8 +68,8 @@ dependencies {
6168
// In other words, Wurst won't compile without this library,
6269
// even though it's Minecraft that actually uses it.
6370
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
64-
}
65-
71+
}
72+
6673
loom {
6774
accessWidenerPath = file("src/main/resources/wurst.accesswidener")
6875
}

gradle.properties

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
# Done to increase the memory available to gradle.
2-
org.gradle.jvmargs=-Xmx2G
3-
org.gradle.parallel=true
4-
org.gradle.configuration-cache=true
5-
6-
# Fabric Properties
7-
# check these at https://fabricmc.net/develop/ and
8-
# https://modrinth.com/mod/fabric-api/versions
9-
minecraft_version=1.21.10
10-
yarn_mappings=1.21.10+build.2
11-
loader_version=0.17.3
12-
loom_version=1.11-SNAPSHOT
13-
14-
# Fabric API
15-
fabric_version=0.135.0+1.21.10
16-
17-
# Mod Properties
18-
mod_version=v7.50.3-MC1.21.10
19-
maven_group=net.wurstclient
20-
archives_base_name=Wurst-Client
21-
mod_loader=Fabric
22-
23-
# GitHub
24-
gh_repo_id=Wurst-Imperium/Wurst7
25-
mcx_repo_id=Wurst-Imperium/Wurst-MCX2
26-
27-
# Dependencies
1+
# Done to increase the memory available to gradle.
2+
org.gradle.jvmargs=-Xmx2G
3+
org.gradle.parallel=true
4+
org.gradle.configuration-cache=true
5+
6+
# Fabric Properties
7+
# check these at https://fabricmc.net/develop/ and
8+
# https://modrinth.com/mod/fabric-api/versions
9+
minecraft_version=1.21.10
10+
yarn_mappings=1.21.10+build.2
11+
loader_version=0.17.3
12+
loom_version=1.13-SNAPSHOT
13+
14+
# Fabric API
15+
fabric_version=0.138.0+1.21.10
16+
17+
# Mod Properties
18+
mod_version=v7.51-MC1.21.10
19+
maven_group=net.wurstclient
20+
archives_base_name=Wurst-Client
21+
mod_loader=Fabric
22+
23+
# GitHub
24+
gh_repo_id=Wurst-Imperium/Wurst7
25+
mcx_repo_id=Wurst-Imperium/Wurst-MCX2
26+
27+
# Dependencies

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)