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

Commit 1190acd

Browse files
authored
Merge pull request #44 from TheKodeToad/format-1.19
Format 1.19
2 parents 68d155e + d942a3b commit 1190acd

File tree

128 files changed

+2865
-2659
lines changed

Some content is hidden

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

128 files changed

+2865
-2659
lines changed

formatting.xml

Lines changed: 399 additions & 0 deletions
Large diffs are not rendered by default.

src/main/java/io/github/axolotlclient/AxolotlClient.java

Lines changed: 118 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -68,150 +68,156 @@
6868
import java.util.List;
6969
import java.util.UUID;
7070

71-
7271
public class AxolotlClient implements ClientModInitializer {
73-
public static String modid = "AxolotlClient";
7472

75-
public static AxolotlClientConfig CONFIG;
76-
public static io.github.axolotlclient.AxolotlclientConfig.ConfigManager configManager;
77-
public static HashMap<UUID, Boolean> playerCache = new HashMap<>();
78-
79-
public static HashMap<Identifier, Resource> runtimeResources = new HashMap<>();
73+
public static String modid = "AxolotlClient";
74+
75+
public static AxolotlClientConfig CONFIG;
76+
public static io.github.axolotlclient.AxolotlclientConfig.ConfigManager configManager;
77+
public static HashMap<UUID, Boolean> playerCache = new HashMap<>();
8078

81-
public static final Identifier badgeIcon = new Identifier("axolotlclient", "textures/badge.png");
79+
public static HashMap<Identifier, Resource> runtimeResources = new HashMap<>();
8280

83-
public static final OptionCategory config = new OptionCategory("storedOptions");
84-
public static final BooleanOption someNiceBackground = new BooleanOption("defNoSecret", false);
85-
public static final List<AbstractModule> modules= new ArrayList<>();
81+
public static final Identifier badgeIcon = new Identifier("axolotlclient", "textures/badge.png");
8682

87-
private static int tickTime = 0;
83+
public static final OptionCategory config = new OptionCategory("storedOptions");
84+
public static final BooleanOption someNiceBackground = new BooleanOption("defNoSecret", false);
85+
public static final List<AbstractModule> modules = new ArrayList<>();
8886

89-
public static UnsupportedMod badmod;
90-
public static boolean titleDisclaimer = false;
91-
public static boolean showWarning = true;
87+
private static int tickTime = 0;
9288

93-
@Override
94-
public void onInitializeClient(ModContainer container) {
89+
public static UnsupportedMod badmod;
90+
public static boolean titleDisclaimer = false;
91+
public static boolean showWarning = true;
9592

96-
if (QuiltLoader.isModLoaded("ares")){
97-
badmod = new UnsupportedMod("Ares Client", UnsupportedMod.UnsupportedReason.BAN_REASON);
98-
} else if (QuiltLoader.isModLoaded("inertia")) {
93+
@Override
94+
public void onInitializeClient(ModContainer container) {
95+
if (QuiltLoader.isModLoaded("ares")) {
96+
badmod = new UnsupportedMod("Ares Client", UnsupportedMod.UnsupportedReason.BAN_REASON);
97+
} else if (QuiltLoader.isModLoaded("inertia")) {
9998
badmod = new UnsupportedMod("Inertia Client", UnsupportedMod.UnsupportedReason.BAN_REASON);
100-
} else if (QuiltLoader.isModLoaded("meteor-client")) {
99+
} else if (QuiltLoader.isModLoaded("meteor-client")) {
101100
badmod = new UnsupportedMod("Meteor Client", UnsupportedMod.UnsupportedReason.BAN_REASON);
102-
} else if (QuiltLoader.isModLoaded("wurst")) {
101+
} else if (QuiltLoader.isModLoaded("wurst")) {
103102
badmod = new UnsupportedMod("Wurst Client", UnsupportedMod.UnsupportedReason.BAN_REASON);
104-
} else if (QuiltLoader.isModLoaded("baritone")) {
103+
} else if (QuiltLoader.isModLoaded("baritone")) {
105104
badmod = new UnsupportedMod("Baritone", UnsupportedMod.UnsupportedReason.BAN_REASON);
106-
} else if (QuiltLoader.isModLoaded("xaerominimap")) {
105+
} else if (QuiltLoader.isModLoaded("xaerominimap")) {
107106
badmod = new UnsupportedMod("Xaero's Minimap", UnsupportedMod.UnsupportedReason.UNKNOWN_CONSEQUENSES);
108107
} else if (QuiltLoader.isModLoaded("essential-container")) {
109-
badmod = new UnsupportedMod("Essential", UnsupportedMod.UnsupportedReason.MIGHT_CRASH, UnsupportedMod.UnsupportedReason.UNKNOWN_CONSEQUENSES);
110-
} else if (QuiltLoader.isModLoaded("optifabric")) {
111-
badmod = new UnsupportedMod("OptiFine", UnsupportedMod.UnsupportedReason.MIGHT_CRASH, UnsupportedMod.UnsupportedReason.UNKNOWN_CONSEQUENSES);
112-
} else {
113-
showWarning = false;
114-
}
108+
badmod = new UnsupportedMod("Essential", UnsupportedMod.UnsupportedReason.MIGHT_CRASH,
109+
UnsupportedMod.UnsupportedReason.UNKNOWN_CONSEQUENSES);
110+
} else if (QuiltLoader.isModLoaded("optifabric")) {
111+
badmod = new UnsupportedMod("OptiFine", UnsupportedMod.UnsupportedReason.MIGHT_CRASH,
112+
UnsupportedMod.UnsupportedReason.UNKNOWN_CONSEQUENSES);
113+
} else {
114+
showWarning = false;
115+
}
115116

116-
CONFIG = new AxolotlClientConfig();
117-
config.add(someNiceBackground);
117+
CONFIG = new AxolotlClientConfig();
118+
config.add(someNiceBackground);
118119

119-
getModules();
120-
addExternalModules();
120+
getModules();
121+
addExternalModules();
121122

122-
CONFIG.init();
123-
modules.forEach(AbstractModule::init);
123+
CONFIG.init();
124+
modules.forEach(AbstractModule::init);
124125

125-
CONFIG.getConfig().addAll(CONFIG.getCategories());
126-
CONFIG.getConfig().add(config);
126+
CONFIG.getConfig().addAll(CONFIG.getCategories());
127+
CONFIG.getConfig().add(config);
127128

128-
AxolotlClientConfigManager.registerConfig(modid, CONFIG, configManager = new DefaultConfigManager(modid, QuiltLoader.getConfigDir().resolve("AxolotlClient.json"), CONFIG.getConfig()));
129-
AxolotlClientConfigManager.addIgnoredName(modid, "x");
130-
AxolotlClientConfigManager.addIgnoredName(modid, "y");
129+
AxolotlClientConfigManager.registerConfig(modid, CONFIG, configManager = new DefaultConfigManager(modid,
130+
QuiltLoader.getConfigDir().resolve("AxolotlClient.json"), CONFIG.getConfig()));
131+
AxolotlClientConfigManager.addIgnoredName(modid, "x");
132+
AxolotlClientConfigManager.addIgnoredName(modid, "y");
131133

132-
modules.forEach(AbstractModule::lateInit);
134+
modules.forEach(AbstractModule::lateInit);
133135

134-
ResourceLoader.registerBuiltinResourcePack(new Identifier("axolotlclient", "axolotlclient-ui"), container, ResourcePackActivationType.NORMAL);
135-
ClientTickEvents.END.register(client -> tickClient());
136+
ResourceLoader.registerBuiltinResourcePack(new Identifier("axolotlclient", "axolotlclient-ui"), container,
137+
ResourcePackActivationType.NORMAL);
138+
ClientTickEvents.END.register(client -> tickClient());
136139

137-
FeatureDisabler.init();
140+
FeatureDisabler.init();
138141

139-
Logger.debug("Debug Output activated, Logs will be more verbose!");
142+
Logger.debug("Debug Output activated, Logs will be more verbose!");
140143

141-
Logger.info("AxolotlClient Initialized");
142-
}
144+
Logger.info("AxolotlClient Initialized");
145+
}
143146

144-
public static void getModules(){
145-
modules.add(SkyResourceManager.getInstance());
146-
modules.add(Zoom.getInstance());
147-
modules.add(HudManager.getInstance());
148-
modules.add(HypixelMods.getInstance());
149-
modules.add(MotionBlur.getInstance());
147+
public static void getModules() {
148+
modules.add(SkyResourceManager.getInstance());
149+
modules.add(Zoom.getInstance());
150+
modules.add(HudManager.getInstance());
151+
modules.add(HypixelMods.getInstance());
152+
modules.add(MotionBlur.getInstance());
150153
modules.add(ScrollableTooltips.getInstance());
151154
modules.add(DiscordRPC.getInstance());
152155
modules.add(Freelook.getInstance());
153156
modules.add(TntTime.getInstance());
154157
modules.add(Particles.getInstance());
155-
modules.add(ScreenshotUtils.getInstance());
156-
}
157-
158-
private static void addExternalModules(){
159-
modules.addAll(ModuleLoader.loadExternalModules());
160-
}
161-
162-
public static boolean isUsingClient(UUID uuid){
163-
assert MinecraftClient.getInstance().player != null;
164-
if (uuid == MinecraftClient.getInstance().player.getUuid()){
165-
return true;
166-
} else {
167-
return NetworkHelper.getOnline(uuid);
168-
}
169-
}
170-
171-
public static void tickClient(){
172-
158+
modules.add(ScreenshotUtils.getInstance());
159+
}
160+
161+
private static void addExternalModules() {
162+
modules.addAll(ModuleLoader.loadExternalModules());
163+
}
164+
165+
public static boolean isUsingClient(UUID uuid) {
166+
assert MinecraftClient.getInstance().player != null;
167+
if (uuid == MinecraftClient.getInstance().player.getUuid()) {
168+
return true;
169+
} else {
170+
return NetworkHelper.getOnline(uuid);
171+
}
172+
}
173+
174+
public static void tickClient() {
173175
modules.forEach(AbstractModule::tick);
174176

175-
if (tickTime >=6000){
176-
177-
//System.out.println("Cleared Cache of Other Players!");
178-
if(playerCache.values().size()>500){
179-
playerCache.clear();
180-
}
181-
tickTime = 0;
182-
}
183-
tickTime++;
184-
185-
}
186-
187-
public static void addBadge(Entity entity, MatrixStack matrices){
188-
if(entity instanceof PlayerEntity && !entity.isSneaky()){
189-
190-
if(AxolotlClient.CONFIG.showBadges.get() && AxolotlClient.isUsingClient(entity.getUuid())) {
177+
if (tickTime >= 6000) {
178+
//System.out.println("Cleared Cache of Other Players!");
179+
if (playerCache.values().size() > 500) {
180+
playerCache.clear();
181+
}
182+
tickTime = 0;
183+
}
184+
tickTime++;
185+
}
186+
187+
public static void addBadge(Entity entity, MatrixStack matrices) {
188+
if (entity instanceof PlayerEntity && !entity.isSneaky()) {
189+
if (AxolotlClient.CONFIG.showBadges.get() && AxolotlClient.isUsingClient(entity.getUuid())) {
191190
RenderSystem.enableDepthTest();
192-
RenderSystem.setShaderTexture(0, AxolotlClient.badgeIcon);
193-
194-
assert MinecraftClient.getInstance().player != null;
195-
int x = -(MinecraftClient.getInstance().textRenderer.getWidth(
196-
entity.getUuid() == MinecraftClient.getInstance().player.getUuid()?
197-
(NickHider.getInstance().hideOwnName.get() ? NickHider.getInstance().hiddenNameSelf.get(): Team.decorateName(entity.getScoreboardTeam(), entity.getName()).getString()):
198-
(NickHider.getInstance().hideOtherNames.get() ? NickHider.getInstance().hiddenNameOthers.get(): Team.decorateName(entity.getScoreboardTeam(), entity.getName()).getString())
199-
)/2 + (AxolotlClient.CONFIG.customBadge.get() ? MinecraftClient.getInstance().textRenderer.getWidth(" "+ Formatting.strip(AxolotlClient.CONFIG.badgeText.get())): 10));
200-
201-
RenderSystem.setShaderColor(1, 1, 1, 1);
202-
203-
if(AxolotlClient.CONFIG.customBadge.get()) {
191+
RenderSystem.setShaderTexture(0, AxolotlClient.badgeIcon);
192+
193+
assert MinecraftClient.getInstance().player != null;
194+
int x = -(MinecraftClient.getInstance().textRenderer
195+
.getWidth(
196+
entity.getUuid() == MinecraftClient.getInstance().player.getUuid()
197+
? (NickHider.getInstance().hideOwnName.get()
198+
? NickHider.getInstance().hiddenNameSelf.get()
199+
: Team.decorateName(entity.getScoreboardTeam(), entity.getName())
200+
.getString())
201+
: (NickHider.getInstance().hideOtherNames.get()
202+
? NickHider.getInstance().hiddenNameOthers.get()
203+
: Team.decorateName(entity.getScoreboardTeam(), entity.getName())
204+
.getString()))
205+
/ 2
206+
+ (AxolotlClient.CONFIG.customBadge.get() ? MinecraftClient.getInstance().textRenderer
207+
.getWidth(" " + Formatting.strip(AxolotlClient.CONFIG.badgeText.get())) : 10));
208+
209+
RenderSystem.setShaderColor(1, 1, 1, 1);
210+
211+
if (AxolotlClient.CONFIG.customBadge.get()) {
204212
Text badgeText = Util.formatFromCodes(AxolotlClient.CONFIG.badgeText.get());
205-
if(AxolotlClient.CONFIG.useShadows.get()) {
206-
MinecraftClient.getInstance().textRenderer.drawWithShadow(matrices, badgeText, x, 0, -1);
207-
} else {
208-
MinecraftClient.getInstance().textRenderer.draw(matrices, badgeText, x, 0, -1);
209-
}
210-
}
211-
else DrawableHelper.drawTexture(matrices, x, 0, 0, 0, 8, 8, 8, 8);
212-
213-
214-
}
215-
}
216-
}
213+
if (AxolotlClient.CONFIG.useShadows.get()) {
214+
MinecraftClient.getInstance().textRenderer.drawWithShadow(matrices, badgeText, x, 0, -1);
215+
} else {
216+
MinecraftClient.getInstance().textRenderer.draw(matrices, badgeText, x, 0, -1);
217+
}
218+
} else
219+
DrawableHelper.drawTexture(matrices, x, 0, 0, 0, 8, 8, 8, 8);
220+
}
221+
}
222+
}
217223
}

src/main/java/io/github/axolotlclient/NetworkHelper.java

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.util.concurrent.TimeUnit;
3939
import java.util.concurrent.atomic.AtomicInteger;
4040

41-
4241
public class NetworkHelper {
4342

4443
private static boolean loggedIn;
@@ -47,53 +46,50 @@ public class NetworkHelper {
4746
private static final AtomicInteger concurrentCalls = new AtomicInteger(0);
4847
private static final int maxCalls = 3;
4948

50-
public static boolean getOnline(UUID uuid){
51-
49+
public static boolean getOnline(UUID uuid) {
5250
if (!AxolotlClient.playerCache.containsKey(uuid)) {
53-
if(concurrentCalls.get() <= maxCalls) {
51+
if (concurrentCalls.get() <= maxCalls) {
5452
concurrentCalls.incrementAndGet();
5553
Runnable runnable = () -> getUser(uuid);
5654
ThreadExecuter.scheduleTask(runnable);
5755
ThreadExecuter.removeTask(runnable);
5856
ThreadExecuter.scheduleTask(concurrentCalls::decrementAndGet, 1, TimeUnit.MINUTES);
5957
}
6058
}
61-
return AxolotlClient.playerCache.get(uuid) != null ? AxolotlClient.playerCache.get(uuid): false;
59+
return AxolotlClient.playerCache.get(uuid) != null ? AxolotlClient.playerCache.get(uuid) : false;
6260
}
6361

64-
public static void getUser(UUID uuid){
65-
try{
62+
public static void getUser(UUID uuid) {
63+
try {
6664
CloseableHttpClient client = HttpClients.createMinimal();
67-
HttpGet get = new HttpGet("https://moehreag.duckdns.org/axolotlclient-api/?uuid="+uuid.toString());
68-
HttpResponse response= client.execute(get);
65+
HttpGet get = new HttpGet("https://moehreag.duckdns.org/axolotlclient-api/?uuid=" + uuid.toString());
66+
HttpResponse response = client.execute(get);
6967
String body = EntityUtils.toString(response.getEntity());
7068
client.close();
71-
if (body.contains("true")){
69+
if (body.contains("true")) {
7270
AxolotlClient.playerCache.put(uuid, true);
7371
} else {
7472
AxolotlClient.playerCache.put(uuid, false);
7573
}
76-
77-
} catch (Exception ignored){
74+
} catch (Exception ignored) {
7875
AxolotlClient.playerCache.put(uuid, false);
7976
}
8077
}
8178

8279
public static void setOnline() {
83-
8480
try {
8581
uuid = MinecraftClient.getInstance().player.getUuid();
8682

8783
CloseableHttpClient client = HttpClients.createDefault();
8884
HttpPost post = new HttpPost("https://moehreag.duckdns.org/axolotlclient-api/");
8985
post.setHeader("Accept", "application/json");
9086
post.setHeader("Content-type", "application/json");
91-
post.setEntity(new StringEntity("{\n\t\"uuid\": \""+uuid.toString()+"\",\n\t\"online\": true\n}"));
87+
post.setEntity(new StringEntity("{\n\t\"uuid\": \"" + uuid.toString() + "\",\n\t\"online\": true\n}"));
9288
HttpResponse response = client.execute(post);
9389
String body = EntityUtils.toString(response.getEntity());
94-
if(body.contains("Success!")){
90+
if (body.contains("Success!")) {
9591
Logger.info("Sucessfully logged in at AxolotlClient!");
96-
loggedIn=true;
92+
loggedIn = true;
9793
}
9894
client.close();
9995
} catch (Exception e) {
@@ -102,13 +98,13 @@ public static void setOnline() {
10298
}
10399
}
104100

105-
public static void setOffline(){
106-
107-
if(loggedIn) {
101+
public static void setOffline() {
102+
if (loggedIn) {
108103
try {
109104
Logger.info("Logging off..");
110105
CloseableHttpClient client = HttpClients.createDefault();
111-
HttpDelete delete = new HttpDelete("https://moehreag.duckdns.org/axolotlclient-api/?uuid=" + uuid.toString());
106+
HttpDelete delete = new HttpDelete(
107+
"https://moehreag.duckdns.org/axolotlclient-api/?uuid=" + uuid.toString());
112108
delete.setHeader("Accept", "application/json");
113109
delete.setHeader("Content-type", "application/json");
114110
HttpResponse response = client.execute(delete);
@@ -119,7 +115,6 @@ public static void setOffline(){
119115
throw new Exception("Error while logging off: " + body);
120116
}
121117
client.close();
122-
123118
} catch (Exception ex) {
124119
ex.printStackTrace();
125120
Logger.error("Error while logging off!");

src/main/java/io/github/axolotlclient/config/modmenu/ModMenuCompat.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
public class ModMenuCompat implements ModMenuApi {
3030

31-
@Override
32-
public ConfigScreenFactory<?> getModConfigScreenFactory() {
33-
return (HudEditScreen::new);
34-
}
31+
@Override
32+
public ConfigScreenFactory<?> getModConfigScreenFactory() {
33+
return (HudEditScreen::new);
34+
}
3535
}

0 commit comments

Comments
 (0)