Skip to content

Commit 35874f2

Browse files
committed
Added Discord Presence and Capes. Updated Mapa and NiceWurst
1 parent debbd26 commit 35874f2

13 files changed

Lines changed: 490 additions & 48 deletions

File tree

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ base {
4343
}
4444

4545
repositories {
46+
mavenCentral()
47+
4648
// Add repositories to retrieve artifacts from in here.
4749
// You should only use this when depending on other mods because
4850
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
@@ -78,6 +80,7 @@ dependencies {
7880
// In other words, Wurst won't compile without this library,
7981
// even though it's Minecraft that actually uses it.
8082
implementation "com.google.code.findbugs:jsr305:3.0.2"
83+
8184
}
8285

8386
fabricApi.configureTests {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fabric_api_version=0.146.1+26.1.2
1515

1616
# Mod Properties
1717
mod_version=v7.53.1-CevAPI-MC26.1.1
18-
fork_release_version=0.50
18+
fork_release_version=0.51
1919
maven_group=net.wurstclient
2020
archives_base_name=Wurst-Client
2121
mod_loader=Fabric

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public final class MapaHack extends Hack
7676
private final SliderSetting minimapSize =
7777
new SliderSetting("Size", 220, 72, 256, 1, ValueDisplay.INTEGER);
7878
private final SliderSetting minimapZoom =
79-
new SliderSetting("Zoom", 2.0, 0.25, 10.0, 0.05, ValueDisplay.DECIMAL);
79+
new SliderSetting("Zoom", 2.0, 0.25, 64.0, 0.05, ValueDisplay.DECIMAL);
8080
private final SliderSetting minimapPosX =
8181
new SliderSetting("Position X", 10, 0, 10000, 1, ValueDisplay.INTEGER);
8282
private final SliderSetting minimapPosY =

src/main/java/net/wurstclient/mapa/config/XMapConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class XMapConfig
5252
public void sanitize()
5353
{
5454
minimapSize = Math.max(72, Math.min(256, minimapSize));
55-
minimapZoom = Math.max(0.25, Math.min(10.0, minimapZoom));
55+
minimapZoom = Math.max(0.25, Math.min(64.0, minimapZoom));
5656
minimapPosX = Math.max(0, minimapPosX);
5757
minimapPosY = Math.max(0, minimapPosY);
5858
playerNameScale = Math.max(0.5, Math.min(4.0, playerNameScale));

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

Lines changed: 65 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,21 @@
2525
import net.minecraft.client.resources.SkinManager;
2626
import net.minecraft.core.UUIDUtil;
2727
import net.minecraft.world.entity.player.PlayerSkin;
28+
import net.wurstclient.WurstClient;
2829
import net.wurstclient.util.json.JsonUtils;
2930
import net.wurstclient.util.json.WsonObject;
3031

3132
@Mixin(SkinManager.class)
3233
public abstract class SkinManagerMixin
3334
{
35+
@Unique
36+
private static final String WURST_CAPES_URL =
37+
"https://www.wurstclient.net/api/v1/capes.json";
38+
39+
@Unique
40+
private static final String FORK_CAPES_URL =
41+
"https://gist.github.com/cev-api/dc3a20eb270a679d172724989f9e6d44/raw/capes.json";
42+
3443
@Unique
3544
private static HashMap<String, String> capes;
3645

@@ -48,8 +57,14 @@ private void onFetchSkinTextures(UUID uuid,
4857

4958
try
5059
{
60+
if(!WurstClient.INSTANCE.getOtfs().wurstCapesOtf.isEnabled())
61+
{
62+
currentCape = null;
63+
return;
64+
}
65+
5166
if(capes == null)
52-
setupWurstCapes();
67+
setupCapeMap();
5368

5469
if(capes.containsKey(uuidString))
5570
{
@@ -85,44 +100,67 @@ private MinecraftProfileTexture modifyCapeTexture(
85100
}
86101

87102
@Unique
88-
private void setupWurstCapes()
103+
private void setupCapeMap()
89104
{
90105
try
91106
{
92107
// assign map first to prevent endless retries if download fails
93108
capes = new HashMap<>();
94-
Pattern uuidPattern = Pattern.compile(
95-
"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}");
109+
loadCapeSource("Wurst",
110+
JsonUtils.parseURLToObject(WURST_CAPES_URL));
111+
loadForkCapeSource();
96112

97-
// download cape list from wurstclient.net
98-
WsonObject rawCapes = JsonUtils.parseURLToObject(
99-
"https://www.wurstclient.net/api/v1/capes.json");
113+
}catch(Exception e)
114+
{
115+
System.err.println("[Wurst] Failed to load cape maps!");
100116

101-
// convert names to offline UUIDs
102-
for(Entry<String, String> entry : rawCapes.getAllStrings()
103-
.entrySet())
117+
e.printStackTrace();
118+
}
119+
}
120+
121+
@Unique
122+
private void loadCapeSource(String sourceName, WsonObject rawCapes)
123+
{
124+
Pattern uuidPattern = Pattern.compile(
125+
"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}");
126+
127+
for(Entry<String, String> entry : rawCapes.getAllStrings().entrySet())
128+
{
129+
String name = entry.getKey();
130+
String capeURL = entry.getValue();
131+
132+
// check if name is already a UUID
133+
if(uuidPattern.matcher(name).matches())
104134
{
105-
String name = entry.getKey();
106-
String capeURL = entry.getValue();
107-
108-
// check if name is already a UUID
109-
if(uuidPattern.matcher(name).matches())
110-
{
111-
capes.put(name, capeURL);
112-
continue;
113-
}
114-
115-
// convert name to offline UUID
116-
String offlineUUID =
117-
"" + UUIDUtil.createOfflinePlayerUUID(name);
118-
capes.put(offlineUUID, capeURL);
135+
capes.put(name, capeURL);
136+
continue;
119137
}
120138

121-
}catch(Exception e)
139+
// convert names to offline UUIDs so the same list can be shared
140+
// between cracked/offline and online-style account names.
141+
String offlineUUID = "" + UUIDUtil.createOfflinePlayerUUID(name);
142+
capes.put(offlineUUID, capeURL);
143+
}
144+
145+
System.out.println("[Wurst] Loaded " + rawCapes.getAllStrings().size()
146+
+ " cape entries from " + sourceName + ".");
147+
}
148+
149+
@Unique
150+
private void loadForkCapeSource()
151+
{
152+
String forkCapesUrl = FORK_CAPES_URL;
153+
if(forkCapesUrl == null || forkCapesUrl.isBlank())
154+
return;
155+
156+
try
122157
{
123-
System.err
124-
.println("[Wurst] Failed to load capes from wurstclient.net!");
158+
loadCapeSource("fork", JsonUtils.parseURLToObject(forkCapesUrl));
125159

160+
}catch(Exception e)
161+
{
162+
System.err.println(
163+
"[Wurst] Failed to load fork capes from " + forkCapesUrl + "!");
126164
e.printStackTrace();
127165
}
128166
}

src/main/java/net/wurstclient/nicewurst/NiceWurstModule.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ public final class NiceWurstModule
5656

5757
private static final EnumMap<Category, Set<String>> ALLOWED_HACKS =
5858
new EnumMap<>(Category.class);
59-
private static final Set<String> ALLOWED_NAME_ONLY = Set.of("ClickGUI",
60-
"Navigator", "AltGUI", "ChorusFruit", "MeasurementESP", "Towny");
59+
private static final Set<String> ALLOWED_NAME_ONLY =
60+
Set.of("ClickGUI", "Navigator", "AltGUI", "XPGUI", "ChorusFruit",
61+
"MeasurementESP", "Towny");
6162

6263
private static final Set<String> HIDDEN_OTHER_FEATURES =
6364
Set.of("Anti-Fingerprint");
@@ -84,8 +85,8 @@ public final class NiceWurstModule
8485
{
8586
ALLOWED_HACKS.put(Category.BLOCKS,
8687
Set.of("AutoBuild", "AutoSign", "AutoTool", "BuildRandom",
87-
"Excavator", "InstantBunker", "ScaffoldWalk", "TemplateTool",
88-
"TargetPlace", "SilkOnly", "MusicAura"));
88+
"Excavator", "HandNoClip", "InstantBunker", "ScaffoldWalk",
89+
"TemplateTool", "TargetPlace", "SilkOnly", "MusicAura"));
8990

9091
ALLOWED_HACKS.put(Category.MOVEMENT, Set.of("BunnyHop", "AutoSprint",
9192
"AutoWalk", "AutoSwim", "Dolphin", "SafeWalk", "Sneak", "InvWalk"));
@@ -97,7 +98,8 @@ public final class NiceWurstModule
9798
Set.of("Breadcrumbs", "DurabilityHUD", "Fullbright", "HealthTags",
9899
"MobHealth", "NameTags", "NewChunks", "NewerNewChunks",
99100
"NoBackground", "NoFireOverlay", "NoVignette", "NoWeather",
100-
"Freecam", "Waypoints", "HideWurst", "ElytraInfo", "Mapa"));
101+
"Freecam", "Waypoints", "HideWurst", "ElytraInfo", "Mapa",
102+
"BedrockStash"));
101103

102104
ALLOWED_HACKS.put(Category.CHAT,
103105
Set.of("AutoChat", "Mention", "NoPlayerChat"));
@@ -109,7 +111,7 @@ public final class NiceWurstModule
109111
"PacketRate", "Panic", "PortalGUI", "SafeTP", "UI-Utils",
110112
"SeedMapperHelper", "TooManyHax", "HideModMenu", "GameStats",
111113
"DamageDetect", "ClientChatOverlay", "CommandScanner",
112-
"GlobalToggle"));
114+
"GlobalToggle", "SpectatorMonitor"));
113115

114116
ALLOWED_HACKS.put(Category.ITEMS,
115117
Set.of("AntiDrop", "AutoDisenchant", "AutoDrop", "AutoEat",

src/main/java/net/wurstclient/options/WurstOptionsScreen.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,22 @@ private void addLinkButtons()
207207
new WurstOptionsButton(54, 24, () -> primaryLabel, primaryTooltip,
208208
b -> os.openUri(primaryUrl));
209209

210-
new WurstOptionsButton(54, 48, () -> "Wurst Website",
210+
new WurstOptionsButton(54, 48, () -> "CevAPI Discord",
211+
"§n§ldiscord.gg/wDgqxkAKFQ",
212+
b -> os.openUri("https://discord.gg/wDgqxkAKFQ"));
213+
214+
new WurstOptionsButton(54, 72, () -> "Wurst Website",
211215
"§n§lWurstClient.net",
212216
b -> os.openUri("https://www.wurstclient.net/options-website/"));
213217

214-
new WurstOptionsButton(54, 72, () -> "Wurst Wiki", "§n§lWurst.Wiki",
218+
new WurstOptionsButton(54, 96, () -> "Wurst Wiki", "§n§lWurst.Wiki",
215219
b -> os.openUri("https://www.wurstclient.net/options-wiki/"));
216220

217-
new WurstOptionsButton(54, 96, () -> "WurstForum", "§n§lWurstForum.net",
221+
new WurstOptionsButton(54, 120, () -> "WurstForum",
222+
"§n§lWurstForum.net",
218223
b -> os.openUri("https://www.wurstclient.net/options-forum/"));
219224

220-
new WurstOptionsButton(54, 120, () -> "Twitter", "@Wurst_Imperium",
225+
new WurstOptionsButton(54, 144, () -> "Twitter", "@Wurst_Imperium",
221226
b -> os.openUri("https://www.wurstclient.net/options-twitter/"));
222227

223228
}

src/main/java/net/wurstclient/other_feature/OtfList.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public final class OtfList
2323
public final CleanUpOtf cleanUpOtf = new CleanUpOtf();
2424
public final ConnectionLogOverlayOtf connectionLogOverlayOtf =
2525
new ConnectionLogOverlayOtf();
26+
public final DiscordRpcOtf discordRpcOtf = new DiscordRpcOtf();
2627
public final ForceAllowChatsOtf forceAllowChatsOtf =
2728
new ForceAllowChatsOtf();
2829
public final DisableOtf disableOtf = new DisableOtf();
@@ -59,7 +60,7 @@ public OtfList()
5960
wurstOptionsOtf.linkAdditionalSettings(disableOtf, commandPrefixOtf,
6061
changelogOtf, connectionLogOverlayOtf, noTelemetryOtf,
6162
noChatReportsOtf, forceAllowChatsOtf, vanillaSpoofOtf,
62-
translationsOtf);
63+
translationsOtf, wurstCapesOtf, discordRpcOtf);
6364

6465
for(Field field : OtfList.class.getDeclaredFields())
6566
{

src/main/java/net/wurstclient/other_features/ConnectionLogOverlayOtf.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public final class ConnectionLogOverlayOtf extends OtherFeature
1616
{
1717
private final CheckboxSetting showConnectionLog =
1818
new CheckboxSetting("Connection log overlay", true);
19-
private final SliderSetting fontScale = new SliderSetting("Font size", 0.7,
20-
0.5, 3.0, 0.05, ValueDisplay.DECIMAL);
19+
private final SliderSetting fontScale = new SliderSetting(
20+
"Overlay Font Size", 0.7, 0.5, 3.0, 0.05, ValueDisplay.DECIMAL);
2121

2222
public ConnectionLogOverlayOtf()
2323
{

0 commit comments

Comments
 (0)