Skip to content

Commit d1d6db0

Browse files
authored
3.1.4 (#149)
2 parents c57b8ba + 30b0528 commit d1d6db0

File tree

427 files changed

+11227
-4115
lines changed

Some content is hidden

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

427 files changed

+11227
-4115
lines changed

1.16_combat-6/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ dependencies {
5858
runtimeOnly("org.lwjgl:lwjgl-nanovg:3.3.2:natives-linux")
5959
runtimeOnly("org.lwjgl:lwjgl-nanovg:3.3.2:natives-windows")
6060
runtimeOnly("org.lwjgl:lwjgl-nanovg:3.3.2:natives-macos")
61+
62+
compileOnly("link.e4mc:e4mc_minecraft:5.3.1")
6163
}
6264

6365
tasks.processResources {

1.16_combat-6/src/main/java/io/github/axolotlclient/AxolotlClient.java

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.ArrayList;
2626
import java.util.HashMap;
2727
import java.util.List;
28+
import java.util.Locale;
2829

2930
import com.google.gson.JsonObject;
3031
import io.github.axolotlclient.AxolotlClientConfig.api.manager.ConfigManager;
@@ -123,23 +124,48 @@ public void onInitializeClient() {
123124

124125
io.github.axolotlclient.AxolotlClientConfig.api.AxolotlClientConfig.getInstance()
125126
.register(configManager = new VersionedJsonConfigManager(AxolotlClientCommon.getInstance().getMainConfigFile(),
126-
CONFIG.config, 3, (oldVersion, newVersion, config, json) -> {
127-
if (oldVersion.getMajor() == 1) {
128-
var keystrokes = json.get("hud").getAsJsonObject().get("keystrokehud")
129-
.getAsJsonObject();
130-
var mousemovement = new JsonObject();
131-
mousemovement.addProperty("enabled", keystrokes.get("enabled").getAsBoolean() && keystrokes.get("mousemovement").getAsBoolean());
132-
mousemovement.addProperty("mouseMovementIndicator", keystrokes.get("mouseMovementIndicator").getAsString());
133-
mousemovement.addProperty("mouseMovementIndicatorOuter", keystrokes.get("mouseMovementIndicatorOuter").getAsString());
134-
json.get("hud").getAsJsonObject().add("mousemovementhud", mousemovement);
127+
CONFIG.config, 4, (oldVersion, newVersion, config, json) -> {
128+
if (oldVersion.getMajor() <= 1) {
129+
if (json.has("hud")) {
130+
var hud = json.get("hud").getAsJsonObject();
131+
if (hud.has("keystrokehud")) {
132+
var keystrokes = hud.get("keystrokehud")
133+
.getAsJsonObject();
134+
var mousemovement = new JsonObject();
135+
mousemovement.addProperty("enabled", keystrokes.get("enabled").getAsBoolean() && keystrokes.get("mousemovement").getAsBoolean());
136+
mousemovement.addProperty("mouseMovementIndicator", keystrokes.get("mouseMovementIndicator").getAsString());
137+
mousemovement.addProperty("mouseMovementIndicatorOuter", keystrokes.get("mouseMovementIndicatorOuter").getAsString());
138+
hud.add("mousemovementhud", mousemovement);
139+
}
140+
}
141+
}
142+
if (oldVersion.getMajor() <= 2) {
143+
if (json.has("hud")) {
144+
var hud = json.get("hud").getAsJsonObject();
145+
if (hud.has("armorhud")) {
146+
var armorhud = hud.get("armorhud").getAsJsonObject();
147+
if (armorhud.has("armorhud.main_hand_item_top")) {
148+
var mainItemTop = armorhud.get("armorhud.main_hand_item_top").getAsBoolean();
149+
if (mainItemTop) {
150+
armorhud.addProperty("armorhud.main_hand_item_position", "armorhud.main_hand_item_position.top");
151+
}
152+
}
153+
}
154+
}
135155
}
136-
if (oldVersion.getMajor() == 2) {
137-
var armorhud = json.get("hud").getAsJsonObject().get("armorhud").getAsJsonObject();
138-
if (armorhud.has("armorhud.main_hand_item_top")) {
139-
var mainItemTop = armorhud.get("armorhud.main_hand_item_top").getAsBoolean();
140-
if (mainItemTop) {
141-
armorhud.addProperty("armorhud.main_hand_item_position", "armorhud.main_hand_item_position.top");
156+
if (oldVersion.getMajor() <= 3) {
157+
if (json.has("storedOptions")) {
158+
var hiddenOptions = json.get("storedOptions").getAsJsonObject();
159+
160+
JsonObject apiOptions;
161+
if (json.has("api.category")) {
162+
apiOptions = json.get("api.category").getAsJsonObject();
163+
} else {
164+
apiOptions = new JsonObject();
165+
json.add("api.category", apiOptions);
142166
}
167+
168+
apiOptions.addProperty("api.privacy_policy_accepted", "privacy_policy_state."+hiddenOptions.get("privacyPolicyAccepted").getAsString().toLowerCase(Locale.ROOT));
143169
}
144170
}
145171
return json;

1.16_combat-6/src/main/java/io/github/axolotlclient/api/APIOptions.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public void init() {
7878
account.add(new GenericOption("api.account.usernames", "clickToOpen",
7979
() -> client.openScreen(new UsernameManagementScreen(client.currentScreen))));
8080
account.add(new GenericOption("api.account.export", "api.account.export_data", () -> ThreadExecuter.scheduleTask(() -> {
81+
if (!API.getInstance().isAuthenticated()) {
82+
API.getInstance().getNotificationProvider().addStatus("api.account.export.failure.title", "api.error.unauthenticated");
83+
return;
84+
}
8185
try (MemoryStack stack = MemoryStack.stackPush()) {
8286
var pointers = stack.mallocPointer(1);
8387
pointers.put(stack.UTF8("*.json"));
@@ -92,14 +96,18 @@ public void init() {
9296
Screen previous = client.currentScreen;
9397
client.openScreen(new ConfirmScreen(b -> {
9498
if (b) {
95-
AccountSettingsRequest.deleteAccount().thenAccept(r -> {
96-
if (r) {
97-
API.getInstance().getNotificationProvider().addStatus("api.account.deletion.success", "api.account.deletion.success.desc");
98-
} else {
99-
API.getInstance().getNotificationProvider().addStatus("api.account.deletion.failure", "api.account.deletion.failure.desc");
100-
}
101-
enabled.set(false);
102-
});
99+
if (!API.getInstance().isAuthenticated()) {
100+
API.getInstance().getNotificationProvider().addStatus("api.account.deletion.failure", "api.error.unauthenticated");
101+
} else {
102+
AccountSettingsRequest.deleteAccount().thenAccept(r -> {
103+
if (r) {
104+
API.getInstance().getNotificationProvider().addStatus("api.account.deletion.success", "api.account.deletion.success.desc");
105+
} else {
106+
API.getInstance().getNotificationProvider().addStatus("api.account.deletion.failure", "api.account.deletion.failure.desc");
107+
}
108+
enabled.set(false);
109+
});
110+
}
103111
}
104112
client.openScreen(previous);
105113
}, new TranslatableText("api.account.confirm_deletion"), new TranslatableText("api.account.confirm_deletion.desc")));
@@ -112,7 +120,6 @@ public void init() {
112120
};
113121
if (Constants.ENABLED) {
114122
AxolotlClient.CONFIG.addCategory(category);
115-
AxolotlClient.config.add(privacyAccepted);
116123
}
117124
}
118125
}

1.16_combat-6/src/main/java/io/github/axolotlclient/api/StatusUpdateProviderImpl.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222

2323
package io.github.axolotlclient.api;
2424

25-
import java.util.Arrays;
26-
import java.util.Optional;
27-
2825
import com.google.gson.JsonObject;
26+
import io.github.axolotlclient.api.e4mc.E4mcStatusProvider;
2927
import io.github.axolotlclient.api.requests.StatusUpdate;
3028
import io.github.axolotlclient.api.util.StatusUpdateProvider;
3129
import net.minecraft.client.MinecraftClient;
@@ -47,14 +45,20 @@ public Request getStatus() {
4745
if (entry != null) {
4846

4947
if (!entry.isLocal()) {
50-
Optional<StatusUpdate.SupportedServer> optional = Arrays.stream(StatusUpdate.SupportedServer.values()).filter(s -> s.getAddress().matcher(entry.address).matches()).findFirst();
48+
// None of these selected servers support CTS versions
49+
/*Optional<StatusUpdate.SupportedServer> optional = Arrays.stream(StatusUpdate.SupportedServer.values()).filter(s -> s.getAddress().matcher(entry.address).matches()).findFirst();
5150
if (optional.isPresent()) {
5251
StatusUpdate.SupportedServer server = optional.get();
5352
54-
}
53+
}*/
54+
return StatusUpdate.inGameServer(entry.name, entry.address);
5555
}
5656
return StatusUpdate.inGameUnknown(entry.name);
5757
} else if (MinecraftClient.getInstance().getServer() != null) {
58+
var e4mcStatus = E4mcStatusProvider.getStatusDescription();
59+
if (e4mcStatus != null) {
60+
return StatusUpdate.e4mcStatusUpdate(e4mcStatus);
61+
}
5862
return StatusUpdate.inGameUnknown(MinecraftClient.getInstance().getServer().getSaveProperties().getLevelName());
5963
}
6064
Screen current = MinecraftClient.getInstance().currentScreen;

1.16_combat-6/src/main/java/io/github/axolotlclient/api/chat/ChatWidget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private void addMessage(ChatMessage message) {
111111
if (!(prev.sender().equals(message.sender()) && prev.senderDisplayName().equals(message.senderDisplayName()))) {
112112
addEntry(new NameChatLine(message));
113113
} else {
114-
if (prev.timestamp().getEpochSecond() - message.timestamp().getEpochSecond() > 150) {
114+
if (message.timestamp().getEpochSecond() - prev.timestamp().getEpochSecond() > 150) {
115115
addEntry(new NameChatLine(message));
116116
}
117117
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright © 2025 moehreag <[email protected]> & Contributors
3+
*
4+
* This file is part of AxolotlClient.
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*
20+
* For more information, see the LICENSE file.
21+
*/
22+
23+
package io.github.axolotlclient.api.e4mc;
24+
25+
import io.github.axolotlclient.api.API;
26+
import io.github.axolotlclient.api.multiplayer.ServerInfoUtil;
27+
import io.github.axolotlclient.api.types.Status;
28+
import link.e4mc.E4mcClient;
29+
import link.e4mc.QuiclimeSession;
30+
import lombok.Setter;
31+
import net.minecraft.client.MinecraftClient;
32+
33+
@Setter
34+
public class AxolotlClientE4mcPlugin {
35+
36+
private String e4mcDomain = null;
37+
38+
public static final AxolotlClientE4mcPlugin INSTANCE = new AxolotlClientE4mcPlugin();
39+
40+
public Status.Activity.E4mcMetadata getStatusDescription() {
41+
MinecraftClient mc = MinecraftClient.getInstance();
42+
var levelName = mc.getServer().getSaveProperties().getLevelName();
43+
if (E4mcClient.session == null || E4mcClient.session.state != QuiclimeSession.State.STARTED) {
44+
if (mc.getServer().getServerMetadata() != null) {
45+
return new Status.Activity.E4mcMetadata(null, ServerInfoUtil.getServerInfo(levelName, mc.getServer().getServerMetadata()));
46+
}
47+
return new Status.Activity.E4mcMetadata(null, ServerInfoUtil.getServerInfo(levelName, null));
48+
}
49+
if (!API.getInstance().getApiOptions().allowFriendsServerJoin.get()) {
50+
return new Status.Activity.E4mcMetadata(null, ServerInfoUtil.getServerInfo(levelName, mc.getServer().getServerMetadata()));
51+
}
52+
return new Status.Activity.E4mcMetadata(e4mcDomain, ServerInfoUtil.getServerInfo(levelName, mc.getServer().getServerMetadata()));
53+
}
54+
55+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright © 2025 moehreag <[email protected]> & Contributors
3+
*
4+
* This file is part of AxolotlClient.
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*
20+
* For more information, see the LICENSE file.
21+
*/
22+
23+
package io.github.axolotlclient.api.e4mc;
24+
25+
import java.util.List;
26+
import java.util.Set;
27+
28+
import net.fabricmc.loader.api.FabricLoader;
29+
import org.objectweb.asm.tree.ClassNode;
30+
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
31+
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
32+
33+
public class E4mcMixinPlugin implements IMixinConfigPlugin {
34+
@Override
35+
public void onLoad(String mixinPackage) {
36+
37+
}
38+
39+
@Override
40+
public String getRefMapperConfig() {
41+
return "e4mc.axolotlclient.refmap.json";
42+
}
43+
44+
@Override
45+
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
46+
return FabricLoader.getInstance().isModLoaded("e4mc_minecraft");
47+
}
48+
49+
@Override
50+
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {
51+
52+
}
53+
54+
@Override
55+
public List<String> getMixins() {
56+
return List.of();
57+
}
58+
59+
@Override
60+
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
61+
62+
}
63+
64+
@Override
65+
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
66+
67+
}
68+
}

common/src/main/java/io/github/axolotlclient/api/util/TimestampParser.java renamed to 1.16_combat-6/src/main/java/io/github/axolotlclient/api/e4mc/E4mcStatusProvider.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2024 moehreag <[email protected]> & Contributors
2+
* Copyright © 2025 moehreag <[email protected]> & Contributors
33
*
44
* This file is part of AxolotlClient.
55
*
@@ -20,12 +20,17 @@
2020
* For more information, see the LICENSE file.
2121
*/
2222

23-
package io.github.axolotlclient.api.util;
23+
package io.github.axolotlclient.api.e4mc;
2424

25-
import java.time.Instant;
25+
import io.github.axolotlclient.api.types.Status;
26+
import net.fabricmc.loader.api.FabricLoader;
2627

27-
public class TimestampParser {
28-
public static Instant parse(String timestamp) {
29-
return Instant.parse(timestamp);
28+
public class E4mcStatusProvider {
29+
30+
public static Status.Activity.E4mcMetadata getStatusDescription() {
31+
if (FabricLoader.getInstance().isModLoaded("e4mc_minecraft")) {
32+
return AxolotlClientE4mcPlugin.INSTANCE.getStatusDescription();
33+
}
34+
return null;
3035
}
3136
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright © 2025 moehreag <[email protected]> & Contributors
3+
*
4+
* This file is part of AxolotlClient.
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*
20+
* For more information, see the LICENSE file.
21+
*/
22+
23+
package io.github.axolotlclient.api.e4mc.mixin;
24+
25+
import com.llamalad7.mixinextras.sugar.Local;
26+
import io.github.axolotlclient.api.e4mc.AxolotlClientE4mcPlugin;
27+
import io.netty.channel.ChannelHandlerContext;
28+
import org.spongepowered.asm.mixin.Mixin;
29+
import org.spongepowered.asm.mixin.injection.At;
30+
import org.spongepowered.asm.mixin.injection.Inject;
31+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
32+
33+
@Mixin(targets = "link/e4mc/QuiclimeSession$3$1", remap = false)
34+
public class QuiclimeSessionInnerMixin {
35+
36+
@Inject(method = "channelRead0", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;info(Ljava/lang/String;Ljava/lang/Object;)V"))
37+
private void axolotlclient$hookE4mcDomain(ChannelHandlerContext ctx, Object msg, CallbackInfo ci, @Local String domain) {
38+
AxolotlClientE4mcPlugin.INSTANCE.setE4mcDomain(domain);
39+
}
40+
}

0 commit comments

Comments
 (0)