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

Conversation

@Floweynt
Copy link
Contributor

@Floweynt Floweynt commented Mar 13, 2025

Provide an internal API over Minecraft to remove duplicated code across minecraft versions.

This is implemented via a set of interfaces, which are injected via loom interface injection (at compile time) and Mixins (at runtime). A stub class will be exposed to common as API, which provides static methods. These methods are overwritten via Mixin at runtime.

Goals:

  • Abstract most version independent logic to common
  • Reduce maintenance burden for new & old features

Non-goals:

  • Provide a stable external interface to third-party modules
  • Implement "multi-version" jars
  • Have "perfect" abstraction - some leaky abstraction is allowed, but these must be for specific edgecases only, e.g. an OpenGL call that's only needed in 1.8.9

Checklist:

  • Implement Bridge API for 1.8.9 (reference implementation for ports)
  • Implement Bridge API for 1.16
  • Implement Bridge API for 1.20
  • Implement Bridge API for 1.21
  • Implement Bridge API for 1.21.4
  • Port most HUD modules
  • Port other modules

During the porting process, 0 or some other suffix may be appended to avoid name collisions. These will be removed once colliding packages & classes have been abstracted away.

Copy link
Member

@moehreag moehreag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of good things, but also still some major issues. Of course, this is nowhere near finished, but the more bugs can be fixed already the less we have to find afterwards.

import net.minecraft.resource.Identifier;
import org.jetbrains.annotations.Nullable;

public class AxoRenderContextImpl implements AxoRenderContext {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 1.8.9, this should ideally be an implementation akin to GuiGraphics on 1.20.1/1.21. On those newer versions, it should be a wrapper implementation. Another reason to prefer newer methods as a base are differences in parameter types and method usages, f.e. in regards to drawing textures (blitSprite methods) due to render types as well as text rendering (which isn't directly being delegated to the TextRenderer/Font). As such, a stateful matrix implementation might be necessary for 1.8.9 as well.

return camera.distanceTo(receiving.getRotationVec(1));
private static double getAttackDistance(AxoEntity attacking, AxoEntity receiving) {
Vec3 camera = attacking.getRotation(1);
return camera.dist(receiving.getRotation(1));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other versions do a manual raycast here which probably works better. However, the method used is not available on 1.8.9.

@Floweynt
Copy link
Contributor Author

Resolved some of the comments. The code currently is ugly and has extraneous diffs, but I will clean them up later with some automated tooling. I just want to get everything in a working state before I deal with that.

@Floweynt
Copy link
Contributor Author

Floweynt commented May 13, 2025

Limiting the scope of this now. Only porting Hypixel and HUD modules, and not even all HUD modules. I want this to be in an usable state in a few months, and begin testing soon.

Future work can include porting other modules / cleanup.

Floweynt and others added 25 commits July 17, 2025 12:33
improve user agent format
- too early initialization of hud bounds
- potion hud sprites
- wrong parameters in gui mixins
- icon hud getting cut off
- trap upgrade icons
- add a few todos
# Conflicts:
#	1.16_combat-6/src/main/java/io/github/axolotlclient/AxolotlClient.java
#	1.16_combat-6/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java
#	1.16_combat-6/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/PotionsHud.java
#	1.16_combat-6/src/main/java/io/github/axolotlclient/modules/hypixel/StatsMod.java
#	1.20/src/main/java/io/github/axolotlclient/AxolotlClient.java
#	1.20/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java
#	1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/PotionsHud.java
#	1.20/src/main/java/io/github/axolotlclient/modules/hypixel/StatsMod.java
#	1.21.7/build.gradle.kts
#	1.21.7/src/main/java/io/github/axolotlclient/AxolotlClient.java
#	1.21.7/src/main/java/io/github/axolotlclient/mixin/PlayerEntityRendererMixin.java
#	1.21.7/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java
#	1.21.7/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/PotionsHud.java
#	1.21.7/src/main/java/io/github/axolotlclient/modules/hypixel/StatsMod.java
#	1.21/src/main/java/io/github/axolotlclient/AxolotlClient.java
#	1.21/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java
#	1.21/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/PotionsHud.java
#	1.21/src/main/java/io/github/axolotlclient/modules/hypixel/StatsMod.java
#	1.8.9/src/main/java/io/github/axolotlclient/AxolotlClient.java
#	1.8.9/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java
#	1.8.9/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/PotionsHud.java
#	1.8.9/src/main/java/io/github/axolotlclient/modules/hypixel/StatsMod.java
#	common/src/main/java/io/github/axolotlclient/AxolotlClientCommon.java
#	common/src/main/resources/assets/axolotlclient/lang/en_us.json
#	gradle.properties
- store filters as base64 to prevent conflicts with commas
@moehreag moehreag marked this pull request as ready for review August 5, 2025 14:56
@moehreag moehreag merged commit b2f1b7e into dev Aug 5, 2025
0 of 2 checks passed
@moehreag moehreag mentioned this pull request Aug 21, 2025
moehreag added a commit that referenced this pull request Aug 30, 2025
**Changelog**:

- fix a few bugs (#154, #155, #168)
- add Bedwars StatsOverlay (#145)
- Fix various hypixel issues (#167)
- add Inventory HUD (#152)
- big internal refactors (#143)
- add Config Profiles (#161)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants