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

Commit d5d1ea2

Browse files
committed
feat: move freelook to common
1 parent 8f504bd commit d5d1ea2

File tree

47 files changed

+597
-1220
lines changed

Some content is hidden

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

47 files changed

+597
-1220
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@
3232
import io.github.axolotlclient.modules.auth.Auth;
3333
import io.github.axolotlclient.modules.blur.MenuBlur;
3434
import io.github.axolotlclient.modules.blur.MotionBlur;
35-
import io.github.axolotlclient.modules.freelook.Freelook;
3635
import io.github.axolotlclient.modules.hud.HudManager;
3736
import io.github.axolotlclient.modules.hypixel.HypixelMods;
3837
import io.github.axolotlclient.modules.particles.Particles;
39-
import io.github.axolotlclient.modules.render.BeaconBeam;
4038
import io.github.axolotlclient.modules.rpc.DiscordRPC;
4139
import io.github.axolotlclient.modules.screenshotUtils.ScreenshotUtils;
4240
import io.github.axolotlclient.modules.scrollableTooltips.ScrollableTooltips;
@@ -45,6 +43,7 @@
4543
import io.github.axolotlclient.modules.tnttime.TntTime;
4644
import io.github.axolotlclient.modules.zoom.Zoom;
4745
import io.github.axolotlclient.util.FeatureDisabler;
46+
import io.github.axolotlclient.util.FeatureDisablerCommon;
4847
import io.github.axolotlclient.util.Logger;
4948
import io.github.axolotlclient.util.LoggerImpl;
5049
import io.github.axolotlclient.util.notifications.Notifications;
@@ -67,7 +66,6 @@ private void addBuiltinModules() {
6766
registerModule(MenuBlur.getInstance());
6867
registerModule(ScrollableTooltips.getInstance());
6968
registerModule(DiscordRPC.getInstance());
70-
registerModule(Freelook.getInstance());
7169
registerModule(TntTime.getInstance());
7270
registerModule(Particles.getInstance());
7371
registerModule(ScreenshotUtils.getInstance());
@@ -96,8 +94,8 @@ public void onInitializeClient() {
9694
}
9795

9896
@Override
99-
protected void initFeatureDisabler() {
100-
FeatureDisabler.init();
97+
protected FeatureDisablerCommon getFeatureDisabler() {
98+
return FeatureDisabler.getInstance();
10199
}
102100

103101
@Override

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/impl/Bridge.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public Identifier getFabricId() {
5151
return new Identifier("axolotlclient", "bridge/resource_listener");
5252
}
5353
});
54+
55+
ClientPlayConnectionEvents.INIT.register((handler, client) ->
56+
Events.JOIN.invoker().accept(new Events.ServerJoinInfo(handler.getConnection().getAddress().toString())));
57+
5458
ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, sender, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
5559
ClientPlayConnectionEvents.DISCONNECT.register((clientPlayNetworkHandler, minecraftClient) -> Events.DISCONNECT.invoker().run());
5660
}

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/mixin/MinecraftClientMixin.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
import io.github.axolotlclient.bridge.AxoMinecraftClient;
2929
import io.github.axolotlclient.bridge.AxoPlayerListEntry;
3030
import io.github.axolotlclient.bridge.AxoSession;
31+
import io.github.axolotlclient.bridge.entity.AxoEntity;
3132
import io.github.axolotlclient.bridge.entity.AxoPlayer;
32-
import io.github.axolotlclient.bridge.key.AxoClientKeybinds;
33+
import io.github.axolotlclient.bridge.AxoGameOptions;
3334
import io.github.axolotlclient.bridge.render.AxoFont;
3435
import io.github.axolotlclient.bridge.resource.AxoResourceManager;
3536
import io.github.axolotlclient.bridge.util.AxoText;
@@ -41,8 +42,10 @@
4142
import net.minecraft.client.network.ClientPlayerEntity;
4243
import net.minecraft.client.network.ServerInfo;
4344
import net.minecraft.client.options.GameOptions;
45+
import net.minecraft.client.render.WorldRenderer;
4446
import net.minecraft.client.util.Session;
4547
import net.minecraft.client.world.ClientWorld;
48+
import net.minecraft.entity.Entity;
4649
import net.minecraft.resource.ResourceManager;
4750
import net.minecraft.text.Text;
4851
import net.minecraft.util.thread.ReentrantThreadExecutor;
@@ -89,6 +92,14 @@ public abstract class MinecraftClientMixin extends ReentrantThreadExecutor<Runna
8992
@Shadow
9093
public abstract ResourceManager getResourceManager();
9194

95+
@Shadow
96+
@Final
97+
public WorldRenderer worldRenderer;
98+
99+
@Shadow
100+
@Nullable
101+
public Entity cameraEntity;
102+
92103
public MinecraftClientMixin(String string) {
93104
super(string);
94105
}
@@ -111,7 +122,7 @@ public MinecraftClientMixin(String string) {
111122

112123
@Override
113124

114-
public AxoClientKeybinds br$getKeybinds() {
125+
public AxoGameOptions br$getGameOptions() {
115126
return options;
116127
}
117128

@@ -161,4 +172,14 @@ public MinecraftClientMixin(String string) {
161172
public Object br$getScreen() {
162173
return currentScreen;
163174
}
175+
176+
@Override
177+
public void br$notifyLevelRenderer() {
178+
worldRenderer.scheduleTerrainUpdate();
179+
}
180+
181+
@Override
182+
public AxoEntity axo$getCameraEntity() {
183+
return cameraEntity;
184+
}
164185
}

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/mixin/key/GameOptionsMixin.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@
2222

2323
package io.github.axolotlclient.bridge.mixin.key;
2424

25-
import io.github.axolotlclient.bridge.key.AxoClientKeybinds;
25+
import io.github.axolotlclient.bridge.AxoGameOptions;
26+
import io.github.axolotlclient.bridge.AxoPerspective;
2627
import io.github.axolotlclient.bridge.key.AxoKeybinding;
2728
import net.minecraft.client.options.GameOptions;
2829
import net.minecraft.client.options.KeyBinding;
30+
import net.minecraft.client.options.Perspective;
2931
import org.spongepowered.asm.mixin.Final;
3032
import org.spongepowered.asm.mixin.Mixin;
3133
import org.spongepowered.asm.mixin.Shadow;
3234

3335
@Mixin(GameOptions.class)
34-
public abstract class GameOptionsMixin implements AxoClientKeybinds {
36+
public abstract class GameOptionsMixin implements AxoGameOptions {
3537
@Shadow
3638
@Final
3739
public KeyBinding keyAttack;
@@ -48,6 +50,12 @@ public abstract class GameOptionsMixin implements AxoClientKeybinds {
4850
@Final
4951
public KeyBinding keyUse;
5052

53+
@Shadow
54+
public abstract Perspective getPerspective();
55+
56+
@Shadow
57+
public abstract void method_31043(Perspective par1);
58+
5159
@Override
5260
public AxoKeybinding br$getSprintKeybind() {
5361
return keySprint;
@@ -67,4 +75,22 @@ public abstract class GameOptionsMixin implements AxoClientKeybinds {
6775
public AxoKeybinding br$getUseKey() {
6876
return keyUse;
6977
}
78+
79+
@Override
80+
public AxoPerspective br$getCameraType() {
81+
return switch (getPerspective()) {
82+
case FIRST_PERSON -> AxoPerspective.FIRST_PERSON;
83+
case THIRD_PERSON_BACK -> AxoPerspective.THIRD_PERSON_BACK;
84+
case THIRD_PERSON_FRONT -> AxoPerspective.THIRD_PERSON_FRONT;
85+
};
86+
}
87+
88+
@Override
89+
public void br$setCameraType(AxoPerspective perspective) {
90+
method_31043(switch (perspective) {
91+
case FIRST_PERSON -> Perspective.FIRST_PERSON;
92+
case THIRD_PERSON_BACK -> Perspective.THIRD_PERSON_BACK;
93+
case THIRD_PERSON_FRONT -> Perspective.THIRD_PERSON_FRONT;
94+
});
95+
}
7096
}

1.16_combat-6/src/main/java/io/github/axolotlclient/modules/freelook/Freelook.java

Lines changed: 0 additions & 180 deletions
This file was deleted.

0 commit comments

Comments
 (0)