Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 7ca3619

Browse files
committed
fix more bugs
- update lwjgl for 1.8.9 - rate limit the user requests to 2/s
1 parent 182a7a5 commit 7ca3619

File tree

26 files changed

+139
-89
lines changed

26 files changed

+139
-89
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import io.github.axolotlclient.AxolotlClientConfig.api.ui.screen.ConfigScreen;
2929
import io.github.axolotlclient.api.chat.ChannelInvitesScreen;
3030
import io.github.axolotlclient.api.chat.ChatListScreen;
31-
import io.github.axolotlclient.api.requests.UserRequest;
31+
import io.github.axolotlclient.api.requests.AccountSettingsRequest;
3232
import io.github.axolotlclient.util.options.GenericOption;
3333
import lombok.Getter;
3434
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
@@ -71,7 +71,7 @@ public void init() {
7171
Screen previous = client.currentScreen;
7272
client.openScreen(new ConfirmScreen(b -> {
7373
if (b) {
74-
UserRequest.delete().thenAccept(r -> {
74+
AccountSettingsRequest.deleteAccount().thenAccept(r -> {
7575
if (r) {
7676
API.getInstance().getNotificationProvider().addStatus("api.account.deletion.success", "api.account.deletion.success.desc");
7777
} else {

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,15 @@ public Request getStatus() {
5757
StatusUpdate.SupportedServer server = optional.get();
5858
if (server.equals(StatusUpdate.SupportedServer.HYPIXEL)) {
5959
JsonObject object = HypixelLocation.get().thenApply(GsonHelper::fromJson).join();
60-
HypixelGameType gameType = HypixelGameType.valueOf(object.get("gametype").getAsString());
60+
String gameType;
61+
if (object.has("gametype")) {
62+
gameType = HypixelGameType.valueOf(object.get("gametype").getAsString()).getName();
63+
} else {
64+
gameType = object.get("server").getAsString();
65+
}
6166
String gameMode = getOrEmpty(object, "mode");
6267
String map = getOrEmpty(object, "map");
63-
return StatusUpdate.inGame(server, gameType.getName(), gameMode, map);
68+
return StatusUpdate.inGame(server, gameType, gameMode, map);
6469
}
6570
}
6671
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import io.github.axolotlclient.api.requests.ChannelRequest;
3131
import io.github.axolotlclient.api.requests.FriendRequest;
3232
import io.github.axolotlclient.api.types.Channel;
33+
import io.github.axolotlclient.api.types.Relation;
3334
import io.github.axolotlclient.api.types.User;
3435
import io.github.axolotlclient.api.util.AlphabeticalComparator;
3536
import io.github.axolotlclient.modules.auth.Auth;
@@ -131,7 +132,10 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
131132
client.execute(() -> client.openScreen(new ChatScreen(screen.getParent(), channel)))));
132133
}).spacer();
133134
}
134-
if (!FriendRequest.getInstance().isBlocked(user.getUuid())) {
135+
if (user.getRelation() != Relation.BLOCKED) {
136+
if (user.getRelation() != Relation.FRIEND) {
137+
menu.entry(new TranslatableText("api.friends.add"), b -> FriendRequest.getInstance().addFriend(user.getUuid())).spacer();
138+
}
135139
menu.entry(new TranslatableText("api.users.block"), buttonWidget ->
136140
FriendRequest.getInstance().blockUser(user));
137141
} else {

1.16_combat-6/src/main/java/io/github/axolotlclient/modules/hypixel/HypixelLocation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static CompletableFuture<String> get() {
3737
}
3838

3939
public static boolean waitingForResponse(String message) {
40-
boolean consume = consumer != null && message.startsWith("{") && message.endsWith("}") && message.contains("gametype");
40+
boolean consume = consumer != null && message.startsWith("{") && message.endsWith("}") && message.contains("server");
4141
if (consume) {
4242
consumer.complete(message);
4343
consumer = null;

1.20/src/main/java/io/github/axolotlclient/api/APIOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import io.github.axolotlclient.AxolotlClientConfig.api.ui.screen.ConfigScreen;
3030
import io.github.axolotlclient.api.chat.ChannelInvitesScreen;
3131
import io.github.axolotlclient.api.chat.ChatListScreen;
32-
import io.github.axolotlclient.api.requests.UserRequest;
32+
import io.github.axolotlclient.api.requests.AccountSettingsRequest;
3333
import io.github.axolotlclient.util.keybinds.KeyBinds;
3434
import io.github.axolotlclient.util.options.GenericOption;
3535
import lombok.Getter;
@@ -70,7 +70,7 @@ public void init() {
7070
Screen previous = client.currentScreen;
7171
client.setScreen(new ConfirmScreen(b -> {
7272
if (b) {
73-
UserRequest.delete().thenAccept(r -> {
73+
AccountSettingsRequest.deleteAccount().thenAccept(r -> {
7474
if (r) {
7575
API.getInstance().getNotificationProvider().addStatus("api.account.deletion.success", "api.account.deletion.success.desc");
7676
} else {

1.20/src/main/java/io/github/axolotlclient/api/StatusUpdateProviderImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,15 @@ public Request getStatus() {
5858
StatusUpdate.SupportedServer server = optional.get();
5959
if (server.equals(StatusUpdate.SupportedServer.HYPIXEL)) {
6060
JsonObject object = HypixelLocation.get().thenApply(GsonHelper::fromJson).join();
61-
HypixelGameType gameType = HypixelGameType.valueOf(object.get("gametype").getAsString());
61+
String gameType;
62+
if (object.has("gametype")) {
63+
gameType = HypixelGameType.valueOf(object.get("gametype").getAsString()).getName();
64+
} else {
65+
gameType = object.get("server").getAsString();
66+
}
6267
String gameMode = getOrEmpty(object, "mode");
6368
String map = getOrEmpty(object, "map");
64-
return StatusUpdate.inGame(server, gameType.getName(), gameMode, map);
69+
return StatusUpdate.inGame(server, gameType, gameMode, map);
6570
} else if (server.equals(StatusUpdate.SupportedServer.MCC_ISLAND)) {
6671
return MccIslandMods.getInstance().getMccIStatus();
6772
}

1.20/src/main/java/io/github/axolotlclient/api/chat/ChatUserListWidget.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import io.github.axolotlclient.api.requests.ChannelRequest;
3131
import io.github.axolotlclient.api.requests.FriendRequest;
3232
import io.github.axolotlclient.api.types.Channel;
33+
import io.github.axolotlclient.api.types.Relation;
3334
import io.github.axolotlclient.api.types.User;
3435
import io.github.axolotlclient.api.util.AlphabeticalComparator;
3536
import io.github.axolotlclient.modules.auth.Auth;
@@ -154,7 +155,10 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
154155
.whenCompleteAsync((channel, throwable) -> client.execute(() -> client.setScreen(new ChatScreen(screen.getParent(), channel))));
155156
}).spacer();
156157
}
157-
if (!FriendRequest.getInstance().isBlocked(user.getUuid())) {
158+
if (user.getRelation() != Relation.BLOCKED) {
159+
if (user.getRelation() != Relation.FRIEND) {
160+
menu.entry(Text.translatable("api.friends.add"), b -> FriendRequest.getInstance().addFriend(user.getUuid())).spacer();
161+
}
158162
menu.entry(Text.translatable("api.users.block"), buttonWidget ->
159163
FriendRequest.getInstance().blockUser(user));
160164
} else {

1.20/src/main/java/io/github/axolotlclient/modules/hypixel/HypixelLocation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static CompletableFuture<String> get() {
3737
}
3838

3939
public static boolean waitingForResponse(String message) {
40-
boolean consume = consumer != null && message.startsWith("{") && message.endsWith("}") && message.contains("gametype");
40+
boolean consume = consumer != null && message.startsWith("{") && message.endsWith("}") && message.contains("server");
4141
if (consume) {
4242
consumer.complete(message);
4343
consumer = null;

1.21.4/src/main/java/io/github/axolotlclient/api/APIOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import io.github.axolotlclient.AxolotlClientConfig.api.ui.screen.ConfigScreen;
3030
import io.github.axolotlclient.api.chat.ChannelInvitesScreen;
3131
import io.github.axolotlclient.api.chat.ChatListScreen;
32-
import io.github.axolotlclient.api.requests.UserRequest;
32+
import io.github.axolotlclient.api.requests.AccountSettingsRequest;
3333
import io.github.axolotlclient.util.keybinds.KeyBinds;
3434
import io.github.axolotlclient.util.options.GenericOption;
3535
import lombok.Getter;
@@ -67,7 +67,7 @@ public void init() {
6767
Screen previous = client.screen;
6868
client.setScreen(new ConfirmScreen(b -> {
6969
if (b) {
70-
UserRequest.delete().thenAccept(r -> {
70+
AccountSettingsRequest.deleteAccount().thenAccept(r -> {
7171
if (r) {
7272
API.getInstance().getNotificationProvider()
7373
.addStatus("api.account.deletion.success", "api.account.deletion.success.desc");

1.21.4/src/main/java/io/github/axolotlclient/api/StatusUpdateProviderImpl.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,15 @@ public Request getStatus() {
6161
StatusUpdate.SupportedServer server = optional.get();
6262
if (server.equals(StatusUpdate.SupportedServer.HYPIXEL)) {
6363
JsonObject object = HypixelLocation.get().thenApply(GsonHelper::fromJson).join();
64-
HypixelGameType gameType =
65-
HypixelGameType.valueOf(object.get("gametype").getAsString());
64+
String gameType;
65+
if (object.has("gametype")) {
66+
gameType = HypixelGameType.valueOf(object.get("gametype").getAsString()).getName();
67+
} else {
68+
gameType = object.get("server").getAsString();
69+
}
6670
String gameMode = getOrEmpty(object, "mode");
6771
String map = getOrEmpty(object, "map");
68-
return StatusUpdate.inGame(server, gameType.getName(), gameMode, map);
72+
return StatusUpdate.inGame(server, gameType, gameMode, map);
6973
} else if (server.equals(StatusUpdate.SupportedServer.MCC_ISLAND)) {
7074
return MccIslandMods.getInstance().getMccIStatus();
7175
}

0 commit comments

Comments
 (0)