Skip to content

Commit 0cc92e8

Browse files
authored
3.1.2 (#141)
- Customizable keystrokes - Mouse movement is now its own HUD element - Custom text-based HUD elements - Add DebugCountersHud, displaying Counters from the F3 screen - Add Bedwars resources HUD - Update NickHider (closes #140 ) - Add /playerstats command to display stats of hypixel gamemodes (`@Floweynt`) - Move config file location - Add various additional options to some HUD elements
2 parents 44e85b2 + f53fd61 commit 0cc92e8

File tree

538 files changed

+18639
-4198
lines changed

Some content is hidden

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

538 files changed

+18639
-4198
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
run: ./gradlew build collectBuilds
3535

3636
- name: Release
37-
uses: Kir-Antipov/[email protected]
37+
uses: Kira-NT/[email protected]
3838
with:
39-
github-token: "${{ secrets.GH_TOKEN }}"
39+
github-token: "${{ secrets.GITHUB_TOKEN }}"
4040
changelog-file: "CHANGELOG.md"
4141
files: builds/*.jar

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.HashMap;
2727
import java.util.List;
2828

29+
import com.google.gson.JsonObject;
2930
import io.github.axolotlclient.AxolotlClientConfig.api.manager.ConfigManager;
3031
import io.github.axolotlclient.AxolotlClientConfig.api.options.OptionCategory;
3132
import io.github.axolotlclient.AxolotlClientConfig.impl.managers.VersionedJsonConfigManager;
@@ -67,12 +68,12 @@ public class AxolotlClient implements ClientModInitializer {
6768

6869
public static final String MODID = "axolotlclient";
6970
public static final HashMap<Identifier, Resource> runtimeResources = new HashMap<>();
70-
public static final Identifier badgeIcon = new Identifier("axolotlclient", "textures/badge.png");
71+
public static final Identifier badgeIcon = new Identifier(MODID, "textures/badge.png");
7172
public static final OptionCategory config = OptionCategory.create("storedOptions");
7273
public static final BooleanOption someNiceBackground = new BooleanOption("defNoSecret", false);
7374
public static final List<Module> modules = new ArrayList<>();
75+
public static final Logger LOGGER = new LoggerImpl();
7476
public static String VERSION;
75-
public static Logger LOGGER;
7677
public static AxolotlClientConfig CONFIG;
7778
public static ConfigManager configManager;
7879

@@ -99,15 +100,9 @@ private static void addExternalModules() {
99100
modules.addAll(ModuleLoader.loadExternalModules());
100101
}
101102

102-
public static void tickClient() {
103-
modules.forEach(Module::tick);
104-
}
105-
106103
@Override
107104
public void onInitializeClient() {
108105

109-
LOGGER = new LoggerImpl();
110-
111106
VERSION = FabricLoader.getInstance().getModContainer(MODID).orElseThrow(IllegalStateException::new)
112107
.getMetadata().getVersion().getFriendlyString();
113108

@@ -116,7 +111,6 @@ public void onInitializeClient() {
116111

117112
getModules();
118113
addExternalModules();
119-
120114
CONFIG.init();
121115

122116
new AxolotlClientCommon(LOGGER, Notifications.getInstance(), () -> configManager);
@@ -128,9 +122,17 @@ public void onInitializeClient() {
128122
CONFIG.config.add(config);
129123

130124
io.github.axolotlclient.AxolotlClientConfig.api.AxolotlClientConfig.getInstance()
131-
.register(configManager = new VersionedJsonConfigManager(FabricLoader.getInstance().getConfigDir().resolve("AxolotlClient.json"),
132-
CONFIG.config, 1, (oldVersion, newVersion, config, json) -> {
133-
// convert changed Options between versions here
125+
.register(configManager = new VersionedJsonConfigManager(AxolotlClientCommon.getInstance().getMainConfigFile(),
126+
CONFIG.config, 2, (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);
135+
}
134136
return json;
135137
}));
136138
configManager.load();
@@ -140,7 +142,7 @@ public void onInitializeClient() {
140142

141143
modules.forEach(Module::lateInit);
142144

143-
ClientTickEvents.END_CLIENT_TICK.register(client -> tickClient());
145+
ClientTickEvents.END_CLIENT_TICK.register(client -> modules.forEach(Module::tick));
144146

145147
FeatureDisabler.init();
146148

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
package io.github.axolotlclient.api;
2424

25-
import java.util.UUID;
26-
2725
import io.github.axolotlclient.api.requests.FriendRequest;
2826
import io.github.axolotlclient.api.util.UUIDHelper;
2927
import io.github.axolotlclient.util.notifications.Notifications;
@@ -36,13 +34,7 @@ public AddFriendScreen(Screen parent) {
3634
super(parent, new TranslatableText("api.screen.friends.add"),
3735
new TranslatableText("api.screen.friends.add.name"), s -> {
3836
if (API.getInstance().isSocketConnected()) {
39-
String uuid;
40-
try {
41-
uuid = API.getInstance().sanitizeUUID(UUID.fromString(s).toString());
42-
} catch (IllegalArgumentException e) {
43-
uuid = UUIDHelper.getUuid(s);
44-
}
45-
FriendRequest.getInstance().addFriend(uuid);
37+
UUIDHelper.ensureUuid(s).thenAccept(FriendRequest.getInstance()::addFriend);
4638
} else {
4739
Notifications.getInstance().addStatus("api.error.notLoggedIn", "api.error.notLoggedIn.desc");
4840
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private void addChat(Channel channel) {
224224
} else {
225225
w = client.textRenderer.getWidth(channel.getName());
226226
}
227-
sidebarWidth = Math.min(Math.max(width * 5 / 12, w + 5), width/2);
227+
sidebarWidth = Math.min(Math.max(width * 5 / 12, w + 5), width / 2);
228228
chatWidget = new ChatWidget(channel, 75, 50, sidebarWidth - 80, height - 100, this);
229229
addChild(chatWidget);
230230
addButton(input = new TextFieldWidget(textRenderer, 75, height - 30, sidebarWidth - 80, 20, new TranslatableText("api.friends.chat.input")) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public Builder entry(AbstractButtonWidget widget) {
158158
}
159159

160160
public Builder spacer() {
161-
elements.add(new ContextMenuEntry(new LiteralText("-----")){
161+
elements.add(new ContextMenuEntry(new LiteralText("-----")) {
162162
@Override
163163
protected MutableText getNarrationMessage() {
164164
return LiteralText.EMPTY.copy();

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
123123
boolean bl2 = keyCode == 264;
124124
if (bl || bl2) {
125125
double d = this.scrollAmount();
126-
this.setScrollAmount(this.scrollAmount() + (double)(bl ? -1 : 1) * this.scrollRate());
126+
this.setScrollAmount(this.scrollAmount() + (double) (bl ? -1 : 1) * this.scrollRate());
127127
if (d != this.scrollAmount()) {
128128
return true;
129129
}
@@ -162,10 +162,10 @@ protected int totalInnerPadding() {
162162
public boolean isMouseOver(double mouseX, double mouseY) {
163163
return this.active
164164
&& this.visible
165-
&& mouseX >= (double)this.getX()
166-
&& mouseY >= (double)this.getY()
167-
&& mouseX < (double)(this.getXEnd() + 6)
168-
&& mouseY < (double)this.getYEnd();
165+
&& mouseX >= (double) this.getX()
166+
&& mouseY >= (double) this.getY()
167+
&& mouseX < (double) (this.getXEnd() + 6)
168+
&& mouseY < (double) this.getYEnd();
169169
}
170170

171171
@Override
@@ -185,11 +185,11 @@ protected void renderBackground(MatrixStack guiGraphics) {
185185
protected void renderBorder(MatrixStack guiGraphics, int x, int y, int width, int height) {
186186
int i = this.isFocused() ? -1 : -6250336;
187187
fill(guiGraphics, this.getX(), this.getY(), this.getXEnd(), this.getYEnd(), i);
188-
fill(guiGraphics, this.getX()+1, this.getY()+1, this.getXEnd()-1, this.getYEnd()-1, -16777216);
188+
fill(guiGraphics, this.getX() + 1, this.getY() + 1, this.getXEnd() - 1, this.getYEnd() - 1, -16777216);
189189
}
190190

191191
protected boolean withinContentAreaTopBottom(int top, int bottom) {
192-
return (double)bottom - this.scrollAmount() >= (double)this.getY() && (double)top - this.scrollAmount() <= (double)(this.getY() + this.height);
192+
return (double) bottom - this.scrollAmount() >= (double) this.getY() && (double) top - this.scrollAmount() <= (double) (this.getY() + this.height);
193193
}
194194

195195
protected abstract int getInnerHeight();
@@ -231,14 +231,14 @@ public boolean mouseScrolled(double mouseX, double mouseY, double scrollY) {
231231
@Override
232232
public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) {
233233
if (this.scrolling) {
234-
if (mouseY < (double)this.getY()) {
234+
if (mouseY < (double) this.getY()) {
235235
this.setScrollAmount(0.0);
236-
} else if (mouseY > (double)this.getYEnd()) {
236+
} else if (mouseY > (double) this.getYEnd()) {
237237
this.setScrollAmount(this.maxScrollAmount());
238238
} else {
239239
double d = Math.max(1, this.maxScrollAmount());
240240
int i = this.scrollerHeight();
241-
double e = Math.max(1.0, d / (double)(this.height - i));
241+
double e = Math.max(1.0, d / (double) (this.height - i));
242242
this.setScrollAmount(this.scrollAmount() + dragY * e);
243243
}
244244

@@ -264,10 +264,10 @@ public void setScrollAmount(double scrollAmount) {
264264
public boolean updateScrolling(double mouseX, double mouseY, int button) {
265265
this.scrolling = this.scrollbarVisible()
266266
&& this.isValidClickButton(button)
267-
&& mouseX >= (double)this.scrollBarX()
268-
&& mouseX <= (double)(this.scrollBarX() + 6)
269-
&& mouseY >= (double)this.getY()
270-
&& mouseY < (double)this.getYEnd();
267+
&& mouseX >= (double) this.scrollBarX()
268+
&& mouseX <= (double) (this.scrollBarX() + 6)
269+
&& mouseY >= (double) this.getY()
270+
&& mouseY < (double) this.getYEnd();
271271
return this.scrolling;
272272
}
273273

@@ -284,30 +284,30 @@ protected boolean scrollbarVisible() {
284284
}
285285

286286
protected int scrollerHeight() {
287-
return MathHelper.clamp((int)((float)(this.height * this.height) / (float)this.contentHeight()), 32, this.height - 8);
287+
return MathHelper.clamp((int) ((float) (this.height * this.height) / (float) this.contentHeight()), 32, this.height - 8);
288288
}
289289

290290
protected int scrollBarX() {
291291
return this.getXEnd() - 6;
292292
}
293293

294294
protected int scrollBarY() {
295-
return Math.max(this.getY(), (int)this.scrollAmount * (this.height - this.scrollerHeight()) / this.maxScrollAmount() + this.getY());
295+
return Math.max(this.getY(), (int) this.scrollAmount * (this.height - this.scrollerHeight()) / this.maxScrollAmount() + this.getY());
296296
}
297297

298298
protected void renderScrollbar(MatrixStack guiGraphics) {
299299
if (this.scrollbarVisible()) {
300300
int i = this.scrollBarX();
301301
int j = this.scrollerHeight();
302302
int k = this.scrollBarY();
303-
fill(guiGraphics, i, getY(), i+SCROLLBAR_WIDTH, getYEnd(), -16777216);
304-
fill(guiGraphics, i, k, i+SCROLLBAR_WIDTH, k+j, -8355712);
305-
fill(guiGraphics, i, k, i+SCROLLBAR_WIDTH-1, k+j-1, -4144960);
303+
fill(guiGraphics, i, getY(), i + SCROLLBAR_WIDTH, getYEnd(), -16777216);
304+
fill(guiGraphics, i, k, i + SCROLLBAR_WIDTH, k + j, -8355712);
305+
fill(guiGraphics, i, k, i + SCROLLBAR_WIDTH - 1, k + j - 1, -4144960);
306306
}
307307
}
308308

309309
protected int getYEnd() {
310-
return getY()+getHeight();
310+
return getY() + getHeight();
311311
}
312312

313313
protected abstract int contentHeight();
@@ -323,7 +323,7 @@ protected int getY() {
323323
}
324324

325325
protected int getXEnd() {
326-
return getX()+getWidth();
326+
return getX() + getWidth();
327327
}
328328
}
329329
}

0 commit comments

Comments
 (0)