Skip to content

Commit 7120b3a

Browse files
Merge v7.51 into 1.21.4
2 parents 3860cdb + 51e6449 commit 7120b3a

File tree

94 files changed

+3401
-796
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

+3401
-796
lines changed

.github/workflows/auto_snapshot_update.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,10 @@ 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
7366
7467
- name: Update version constants
7568
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 {
@@ -65,8 +72,8 @@ dependencies {
6572
// In other words, Wurst won't compile without this library,
6673
// even though it's Minecraft that actually uses it.
6774
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
68-
}
69-
75+
}
76+
7077
loom {
7178
accessWidenerPath = file("src/main/resources/wurst.accesswidener")
7279
}

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=-Xmx1G
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.4
10-
yarn_mappings=1.21.4+build.8
11-
loader_version=0.17.3
12-
loom_version=1.11-SNAPSHOT
13-
14-
# Fabric API
15-
fabric_version=0.119.4+1.21.4
16-
17-
# Mod Properties
18-
mod_version=v7.50.3-MC1.21.4
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=-Xmx1G
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.4
10+
yarn_mappings=1.21.4+build.8
11+
loader_version=0.17.3
12+
loom_version=1.13-SNAPSHOT
13+
14+
# Fabric API
15+
fabric_version=0.119.4+1.21.4
16+
17+
# Mod Properties
18+
mod_version=v7.51-MC1.21.4
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.4";
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
@@ -25,7 +25,7 @@ public final class BlockComponent extends Component
2525
{
2626
private static final ClickGui GUI = WURST.getGui();
2727
private static final TextRenderer TR = MC.textRenderer;
28-
private static final int BLOCK_WITDH = 24;
28+
private static final int BLOCK_WIDTH = 24;
2929

3030
private final BlockSetting setting;
3131

@@ -39,7 +39,7 @@ public BlockComponent(BlockSetting setting)
3939
@Override
4040
public void handleMouseClick(double mouseX, double mouseY, int mouseButton)
4141
{
42-
if(mouseX < getX() + getWidth() - BLOCK_WITDH)
42+
if(mouseX < getX() + getWidth() - BLOCK_WIDTH)
4343
return;
4444

4545
switch(mouseButton)
@@ -60,7 +60,7 @@ public void render(DrawContext context, int mouseX, int mouseY,
6060
{
6161
int x1 = getX();
6262
int x2 = x1 + getWidth();
63-
int x3 = x2 - BLOCK_WITDH;
63+
int x3 = x2 - BLOCK_WIDTH;
6464
int y1 = getY();
6565
int y2 = y1 + getHeight();
6666

@@ -124,12 +124,12 @@ private String getBlockTooltip()
124124
@Override
125125
public int getDefaultWidth()
126126
{
127-
return TR.getWidth(setting.getName() + ":") + BLOCK_WITDH + 4;
127+
return TR.getWidth(setting.getName() + ":") + BLOCK_WIDTH + 4;
128128
}
129129

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

0 commit comments

Comments
 (0)