Skip to content

Commit ac03fc5

Browse files
committed
Force Allow Chats
1 parent ff4f37a commit ac03fc5

6 files changed

Lines changed: 106 additions & 1 deletion

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,14 @@ This hack is still undergoing development and has only been tested in the end. A
829829
- Plays a sound when your username or a nickname/derivative is detected in chat
830830
- Choose from any of the note blocks and adjust the volume
831831

832+
### Force Allow Chats
833+
- When on it forces Mojang account properties to follow:
834+
- Chat Allowed
835+
- Realms Allowed
836+
- Servers Allowed
837+
- Intercepts ```YggdrasilUserApiService.fetchProperties() ```
838+
- Accessible before game via Wurst Options or in-game via Chat category hack.
839+
832840
## What's changed or improved in this fork?
833841

834842
### ChestESP
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2014-2026 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.mixin;
9+
10+
import java.util.Map;
11+
import java.util.Set;
12+
13+
import org.spongepowered.asm.mixin.Mixin;
14+
import org.spongepowered.asm.mixin.injection.At;
15+
import org.spongepowered.asm.mixin.injection.Inject;
16+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
17+
18+
import com.mojang.authlib.minecraft.UserApiService.UserFlag;
19+
import com.mojang.authlib.minecraft.UserApiService.UserProperties;
20+
import com.mojang.authlib.yggdrasil.YggdrasilUserApiService;
21+
22+
import net.wurstclient.WurstClient;
23+
24+
@Mixin(value = YggdrasilUserApiService.class, remap = false)
25+
public class YggdrasilUserApiServiceMixin
26+
{
27+
@Inject(method = "fetchProperties",
28+
at = @At("HEAD"),
29+
cancellable = true,
30+
remap = false)
31+
private void wurst$forceAllowChats(
32+
CallbackInfoReturnable<UserProperties> cir)
33+
{
34+
if(WurstClient.INSTANCE.getOtfs() == null)
35+
return;
36+
37+
if(!WurstClient.INSTANCE.getOtfs().forceAllowChatsOtf
38+
.isForceAllowChatsEnabled())
39+
return;
40+
41+
cir.setReturnValue(new UserProperties(Set.of(UserFlag.CHAT_ALLOWED,
42+
UserFlag.REALMS_ALLOWED, UserFlag.SERVERS_ALLOWED), Map.of()));
43+
}
44+
}

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ private void addSettingButtons()
6969
wurst.getOtfs().translationsOtf.getForceEnglish();
7070
CheckboxSetting unsafeChatToast =
7171
wurst.getOtfs().noChatReportsOtf.getUnsafeChatToast();
72+
CheckboxSetting forceAllowChats =
73+
wurst.getOtfs().forceAllowChatsOtf.getForceAllowChatsSetting();
7274
net.wurstclient.other_features.CommandPrefixOtf commandPrefixOtf =
7375
wurst.getOtfs().commandPrefixOtf;
7476
ConnectionLogOverlayOtf connectionLogOtf =
@@ -112,7 +114,14 @@ private void addSettingButtons()
112114
+ (unsafeChatToast.isChecked() ? "ON" : "OFF"),
113115
"Shows a toast warning when a server enforces insecure chat/reporting.",
114116
b -> unsafeChatToast.setChecked(!unsafeChatToast.isChecked()));
115-
int optionY = 144;
117+
118+
new WurstOptionsButton(-154, 144,
119+
() -> "Force Allow Chats: "
120+
+ (forceAllowChats.isChecked() ? "ON" : "OFF"),
121+
"Forces Mojang user properties to allow chat, Realms, and servers.",
122+
b -> forceAllowChats.setChecked(!forceAllowChats.isChecked()));
123+
124+
int optionY = 168;
116125
if(NiceWurstModule.showAntiFingerprintControls())
117126
{
118127
new WurstOptionsButton(-154, optionY, () -> "Anti-Fingerprint",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public final class OtfList
2222
public final CleanUpOtf cleanUpOtf = new CleanUpOtf();
2323
public final ConnectionLogOverlayOtf connectionLogOverlayOtf =
2424
new ConnectionLogOverlayOtf();
25+
public final ForceAllowChatsOtf forceAllowChatsOtf =
26+
new ForceAllowChatsOtf();
2527
public final DisableOtf disableOtf = new DisableOtf();
2628
public final HackListOtf hackListOtf = new HackListOtf();
2729
public final KeybindManagerOtf keybindManagerOtf = new KeybindManagerOtf();
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2014-2026 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.other_features;
9+
10+
import net.wurstclient.Category;
11+
import net.wurstclient.other_feature.OtherFeature;
12+
import net.wurstclient.settings.CheckboxSetting;
13+
14+
public final class ForceAllowChatsOtf extends OtherFeature
15+
{
16+
private final CheckboxSetting forceAllowChats =
17+
new CheckboxSetting("Force Allow Chats", false);
18+
19+
public ForceAllowChatsOtf()
20+
{
21+
super("ForceAllowChats",
22+
"Forces Mojang user properties to allow chat, Realms, and servers.");
23+
addSetting(forceAllowChats);
24+
}
25+
26+
public CheckboxSetting getForceAllowChatsSetting()
27+
{
28+
return forceAllowChats;
29+
}
30+
31+
public boolean isForceAllowChatsEnabled()
32+
{
33+
return forceAllowChats.isChecked();
34+
}
35+
36+
@Override
37+
public Category getCategory()
38+
{
39+
return Category.CHAT;
40+
}
41+
}

src/main/resources/wurst.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"WorldEnvironmentAttributeAccessMixin",
8888
"WorldMixin",
8989
"WorldRendererMixin",
90+
"YggdrasilUserApiServiceMixin",
9091
"freecam.CameraMixin",
9192
"freecam.ItemInHandRendererMixin",
9293
"freecam.LocalPlayerMixin",

0 commit comments

Comments
 (0)