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

Commit be5229e

Browse files
committed
fix more bugs
1 parent 6659c4d commit be5229e

File tree

17 files changed

+144
-74
lines changed

17 files changed

+144
-74
lines changed

1.16_combat-6/src/main/java/io/github/axolotlclient/modules/auth/Auth.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ public void init() {
6666
this.auth = new MSAuth(AxolotlClient.LOGGER, this, () -> client.options.language);
6767
if (isContained(client.getSession().getUuid())) {
6868
current = getAccounts().stream().filter(account -> account.getUuid().equals(client.getSession().getUuid())).toList().get(0);
69-
if (current.needsRefresh()) {
69+
current.setAuthToken(client.getSession().getAccessToken());
70+
current.setName(client.getSession().getUsername());
71+
/*if (current.needsRefresh()) {
7072
current.refresh(auth).thenRun(this::save);
71-
}
73+
}*/
7274
} else {
7375
current = new Account(client.getSession().getUsername(), client.getSession().getUuid(), client.getSession().getAccessToken());
7476
}

1.16_combat-6/src/main/java/io/github/axolotlclient/modules/hypixel/bedwars/upgrades/TrapUpgrade.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class TrapUpgrade extends TeamUpgrade {
5454
private final static Pattern[] REGEX = {
5555
Pattern.compile("^\\b[A-Za-z0-9_§]{3,16}\\b purchased (.+) Trap.?\\s*$"),
5656
Pattern.compile("Trap was set (off)!"),
57+
Pattern.compile("Removed (.+) from the (queue)!\\s*$")
5758
};
5859

5960
private final List<TrapType> traps = new ArrayList<>(3);
@@ -69,7 +70,12 @@ protected void onMatch(TeamUpgrade upgrade, Matcher matcher) {
6970
traps.remove(0);
7071
return;
7172
}
72-
traps.add(TrapType.getFuzzy(matcher.group(1)));
73+
TrapType type = TrapType.getFuzzy(matcher.group(1));
74+
if (matcher.groupCount() >= 2 && matcher.group(2).equals("queue")) {
75+
traps.remove(type);
76+
return;
77+
}
78+
traps.add(type);
7379
}
7480

7581
public boolean canPurchase() {

1.20/src/main/java/io/github/axolotlclient/modules/auth/Auth.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ public void init() {
7070
if (isContained(client.getSession().getSessionId())) {
7171
current = getAccounts().stream().filter(account -> account.getUuid()
7272
.equals(UUIDTypeAdapter.fromUUID(client.getSession().getPlayerUuid()))).toList().get(0);
73-
if (current.needsRefresh()) {
73+
current.setAuthToken(client.getSession().getAccessToken());
74+
current.setName(client.getSession().getUsername());
75+
/*if (current.needsRefresh()) {
7476
current.refresh(auth).thenRun(this::save);
75-
}
77+
}*/
7678
} else {
7779
current = new Account(client.getSession().getUsername(), UUIDTypeAdapter.fromUUID(client.getSession().getPlayerUuid()), client.getSession().getAccessToken());
7880
}

1.20/src/main/java/io/github/axolotlclient/modules/hypixel/bedwars/upgrades/TrapUpgrade.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class TrapUpgrade extends TeamUpgrade {
4949
private final static Pattern[] REGEX = {
5050
Pattern.compile("^\\b[A-Za-z0-9_§]{3,16}\\b purchased (.+) Trap.?\\s*$"),
5151
Pattern.compile("Trap was set (off)!"),
52+
Pattern.compile("Removed (.+) from the (queue)!\\s*$")
5253
};
5354

5455
private final List<TrapType> traps = new ArrayList<>(3);
@@ -64,7 +65,12 @@ protected void onMatch(TeamUpgrade upgrade, Matcher matcher) {
6465
traps.remove(0);
6566
return;
6667
}
67-
traps.add(TrapType.getFuzzy(matcher.group(1)));
68+
TrapType type = TrapType.getFuzzy(matcher.group(1));
69+
if (matcher.groupCount() >= 2 && matcher.group(2).equals("queue")) {
70+
traps.remove(type);
71+
return;
72+
}
73+
traps.add(type);
6874
}
6975

7076
public boolean canPurchase() {

1.21.4/src/main/java/io/github/axolotlclient/modules/hypixel/bedwars/upgrades/TrapUpgrade.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class TrapUpgrade extends TeamUpgrade {
5050
private final static Pattern[] REGEX = {
5151
Pattern.compile("^\\b[A-Za-z0-9_§]{3,16}\\b purchased (.+) Trap.?\\s*$"),
5252
Pattern.compile("Trap was set (off)!"),
53+
Pattern.compile("Removed (.+) from the (queue)!\\s*$")
5354
};
5455

5556
private final List<TrapType> traps = new ArrayList<>(3);
@@ -65,7 +66,12 @@ protected void onMatch(TeamUpgrade upgrade, Matcher matcher) {
6566
traps.removeFirst();
6667
return;
6768
}
68-
traps.add(TrapType.getFuzzy(matcher.group(1)));
69+
TrapType type = TrapType.getFuzzy(matcher.group(1));
70+
if (matcher.groupCount() >= 2 && matcher.group(2).equals("queue")) {
71+
traps.remove(type);
72+
return;
73+
}
74+
traps.add(type);
6975
}
7076

7177
public boolean canPurchase() {

1.21/src/main/java/io/github/axolotlclient/modules/auth/Auth.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ public void init() {
6969
if (isContained(client.getSession().getSessionId())) {
7070
current = getAccounts().stream().filter(account -> account.getUuid()
7171
.equals(UndashedUuid.toString(client.getSession().getPlayerUuid()))).toList().getFirst();
72-
if (current.needsRefresh()) {
72+
current.setAuthToken(client.getSession().getAccessToken());
73+
current.setName(client.getSession().getUsername());
74+
/*if (current.needsRefresh()) {
7375
current.refresh(auth).thenRun(this::save);
74-
}
76+
}*/
7577
} else {
7678
current = new Account(client.getSession().getUsername(), UndashedUuid.toString(client.getSession().getPlayerUuid()), client.getSession().getAccessToken());
7779
}

1.21/src/main/java/io/github/axolotlclient/modules/hypixel/bedwars/upgrades/TrapUpgrade.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class TrapUpgrade extends TeamUpgrade {
4949
private final static Pattern[] REGEX = {
5050
Pattern.compile("^\\b[A-Za-z0-9_§]{3,16}\\b purchased (.+) Trap.?\\s*$"),
5151
Pattern.compile("Trap was set (off)!"),
52+
Pattern.compile("Removed (.+) from the (queue)!\\s*$")
5253
};
5354

5455
private final List<TrapType> traps = new ArrayList<>(3);
@@ -64,7 +65,12 @@ protected void onMatch(TeamUpgrade upgrade, Matcher matcher) {
6465
traps.removeFirst();
6566
return;
6667
}
67-
traps.add(TrapType.getFuzzy(matcher.group(1)));
68+
TrapType type = TrapType.getFuzzy(matcher.group(1));
69+
if (matcher.groupCount() >= 2 && matcher.group(2).equals("queue")) {
70+
traps.remove(type);
71+
return;
72+
}
73+
traps.add(type);
6874
}
6975

7076
public boolean canPurchase() {

1.8.9/src/main/java/io/github/axolotlclient/mixin/ClientPlayNetworkHandlerMixin.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
package io.github.axolotlclient.mixin;
2424

25+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
26+
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
2527
import com.llamalad7.mixinextras.sugar.Local;
2628
import io.github.axolotlclient.modules.hud.HudManager;
2729
import io.github.axolotlclient.modules.hud.gui.hud.simple.TPSHud;
@@ -31,6 +33,7 @@
3133
import net.minecraft.network.packet.s2c.play.ScoreboardObjectiveS2CPacket;
3234
import net.minecraft.network.packet.s2c.play.TeamS2CPacket;
3335
import net.minecraft.network.packet.s2c.play.WorldTimeS2CPacket;
36+
import net.minecraft.scoreboard.Scoreboard;
3437
import net.minecraft.scoreboard.ScoreboardObjective;
3538
import net.minecraft.scoreboard.team.Team;
3639
import org.spongepowered.asm.mixin.Mixin;
@@ -58,6 +61,15 @@ private void noStackTraceOnNullTeam(TeamS2CPacket teamS2CPacket, CallbackInfo ci
5861
}
5962
}
6063

64+
@WrapOperation(method = "handleTeam", at = @At(value = "INVOKE", target = "Lnet/minecraft/scoreboard/Scoreboard;addTeam(Ljava/lang/String;)Lnet/minecraft/scoreboard/team/Team;"))
65+
private Team noStackTraceOnAlreadyExistingTeam(Scoreboard instance, String s, Operation<Team> original, @Local Scoreboard scoreboard){
66+
Team team = scoreboard.getTeam(s);
67+
if (team == null) {
68+
return original.call(instance, s);
69+
}
70+
return team;
71+
}
72+
6173
@Inject(method = "handleScoreboardObjective", at = @At(value = "INVOKE", target = "Lnet/minecraft/scoreboard/Scoreboard;removeObjective(Lnet/minecraft/scoreboard/ScoreboardObjective;)V"), cancellable = true)
6274
private void noStackTraceOnNullScoreboardObjective(ScoreboardObjectiveS2CPacket scoreboardObjectiveS2CPacket, CallbackInfo ci, @Local ScoreboardObjective objective){
6375
if (objective == null) {
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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.mixin;
24+
25+
import net.minecraft.entity.ItemEntity;
26+
import org.apache.logging.log4j.Logger;
27+
import org.spongepowered.asm.mixin.Mixin;
28+
import org.spongepowered.asm.mixin.injection.At;
29+
import org.spongepowered.asm.mixin.injection.Redirect;
30+
31+
@Mixin(ItemEntity.class)
32+
public class ItemEntityMixin {
33+
34+
@Redirect(method = "getItemStack", at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;)V", remap = false))
35+
private void removeErrorLogging(Logger instance, String s) {
36+
37+
}
38+
}

1.8.9/src/main/java/io/github/axolotlclient/modules/auth/Auth.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ public void init() {
6767
this.auth = new MSAuth(AxolotlClient.LOGGER, this, () -> client.options.language);
6868
if (isContained(client.getSession().getUuid())) {
6969
current = getAccounts().stream().filter(account -> account.getUuid().equals(client.getSession().getUuid())).toList().get(0);
70-
if (current.needsRefresh()) {
70+
current.setAuthToken(client.getSession().getAccessToken());
71+
current.setName(client.getSession().getUsername());
72+
/*if (current.needsRefresh()) {
7173
current.refresh(auth).thenRun(this::save);
72-
}
74+
}*/
7375
} else {
7476
current = new Account(client.getSession().getUsername(), client.getSession().getUuid(), client.getSession().getAccessToken());
7577
}

0 commit comments

Comments
 (0)