Skip to content

Commit ba78285

Browse files
committed
Fix TitleScreenMixin
1 parent 73d545c commit ba78285

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def buildConfigOutput =
176176
tasks.register("generateBuildConfig") {
177177
def template =
178178
file("src/main/templates/net/wurstclient/config/BuildConfig.java.in")
179+
def modVersionValue = project.mod_version
179180

180181
inputs.file(template)
181182
inputs.property("niceWurstEnabled", niceWurstEnabled)
@@ -189,6 +190,7 @@ tasks.register("generateBuildConfig") {
189190

190191
def content = template.getText("UTF-8")
191192
.replace('${NICE_WURST}', String.valueOf(niceWurstEnabled))
193+
.replace('${MOD_VERSION}', modVersionValue)
192194

193195
def targetFile = new File(targetDir, "BuildConfig.java")
194196
targetFile.setText(content, "UTF-8")

src/main/java/net/wurstclient/mixin/TitleScreenMixin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import net.minecraft.network.chat.Component;
2525
import net.wurstclient.WurstClient;
2626
import net.wurstclient.altmanager.screens.AltManagerScreen;
27+
import net.wurstclient.config.BuildConfig;
2728
import net.wurstclient.nicewurst.NiceWurstModule;
2829

2930
@Mixin(TitleScreen.class)
@@ -92,7 +93,8 @@ private void onRender(GuiGraphics graphics, int mouseX, int mouseY,
9293
float partialTicks, CallbackInfo ci)
9394
{
9495
Font font = minecraft.font;
95-
java.lang.String text = "Wurst 7.51.2 Modified by CevAPI";
96+
String brand = NiceWurstModule.isActive() ? "NiceWurst" : "Wurst";
97+
String text = brand + " " + BuildConfig.MOD_VERSION;
9698
graphics.drawString(font, Component.literal(text).getVisualOrderText(),
9799
4, 4, 0xFFFFFFFF, true);
98100
}

src/main/templates/net/wurstclient/config/BuildConfig.java.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ public final class BuildConfig
55
private BuildConfig() {}
66

77
public static final boolean NICE_WURST = ${NICE_WURST};
8+
public static final String MOD_VERSION = "${MOD_VERSION}";
89
}

0 commit comments

Comments
 (0)