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

Commit ae5d385

Browse files
committed
Merge branch '1.8.9' of https://github.com/AxolotlClient/AxolotlClient-mod into 1.8.9
2 parents 9b08b07 + 61c6078 commit ae5d385

File tree

20 files changed

+250
-146
lines changed

20 files changed

+250
-146
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ run/
2727
*.DS_Store
2828
src/main/resources/assets/minecraft/textures/entity/alex.png
2929
src/main/resources/assets/minecraft/textures/entity/steve.png
30-
run/options.txt

run/options.txt

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

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import io.github.axolotlclient.config.options.BooleanOption;
88
import io.github.axolotlclient.config.options.OptionCategory;
99
import io.github.axolotlclient.modules.AbstractModule;
10+
import io.github.axolotlclient.modules.freelook.Freelook;
1011
import io.github.axolotlclient.modules.hud.HudManager;
1112
import io.github.axolotlclient.modules.hypixel.HypixelMods;
1213
import io.github.axolotlclient.modules.hypixel.nickhider.NickHider;
@@ -54,14 +55,13 @@ public class AxolotlClient implements ClientModInitializer {
5455

5556
@Override
5657
public void onInitializeClient() {
57-
5858
CONFIG = new AxolotlClientConfig();
5959
config.add(someNiceBackground);
6060
config.add(CONFIG.rotateWorld);
6161

6262
getModules();
6363
CONFIG.init();
64-
modules.forEach((identifier, abstractModule) -> abstractModule.init());
64+
modules.values().forEach(AbstractModule::init);
6565

6666
CONFIG.config.addAll(CONFIG.getCategories());
6767
CONFIG.config.add(config);
@@ -70,7 +70,7 @@ public void onInitializeClient() {
7070

7171
//if (CONFIG.enableRPC.get()) io.github.axolotlclient.util.DiscordRPC.startup();
7272

73-
modules.forEach((identifier, abstractModule) -> abstractModule.lateInit());
73+
modules.values().forEach(AbstractModule::lateInit);
7474

7575
FabricLoader.getInstance().getModContainer("axolotlclient").ifPresent(modContainer -> {
7676
Optional<Path> optional = modContainer.findPath("resourcepacks/AxolotlClientUI.zip");
@@ -86,8 +86,9 @@ public static void getModules(){
8686
modules.put(HudManager.ID, HudManager.getINSTANCE());
8787
modules.put(HypixelMods.ID, HypixelMods.INSTANCE);
8888
modules.put(MotionBlur.ID, new MotionBlur());
89-
modules.put(ScrollableTooltips.ID, ScrollableTooltips.Instance);
89+
modules.put(ScrollableTooltips.ID, ScrollableTooltips.instance);
9090
modules.put(DiscordRPC.ID, DiscordRPC.getInstance());
91+
modules.put(Freelook.ID, Freelook.INSTANCE);
9192
}
9293

9394
public static boolean isUsingClient(UUID uuid){
@@ -101,8 +102,8 @@ public static boolean isUsingClient(UUID uuid){
101102

102103

103104
public static void tickClient(){
105+
modules.values().forEach(AbstractModule::tick);
104106

105-
modules.forEach((identifier, abstractModule) -> abstractModule.tick());
106107
//net.arikia.dev.drpc.DiscordRPC.discordRunCallbacks();
107108
Color.tickChroma();
108109

src/main/java/io/github/axolotlclient/config/ConfigManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ public static void load() {
6161
JsonObject config = new JsonParser().parse(new FileReader(confPath.toString())).getAsJsonObject();
6262

6363
for(OptionCategory category:categories) {
64-
setOptions(config.get(category.getName()).getAsJsonObject(), category);
64+
if(config.has(category.getName())) {
65+
setOptions(config.get(category.getName()).getAsJsonObject(), category);
66+
}
6567
}
6668
} catch (Exception e){
6769
AxolotlClient.LOGGER.error("Failed to load config! Using default values... \nError: ");
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package io.github.axolotlclient.mixin;
2+
3+
import org.spongepowered.asm.mixin.Mixin;
4+
import org.spongepowered.asm.mixin.injection.At;
5+
import org.spongepowered.asm.mixin.injection.Redirect;
6+
7+
import io.github.axolotlclient.modules.freelook.Freelook;
8+
import net.minecraft.client.render.entity.EntityRenderDispatcher;
9+
import net.minecraft.entity.Entity;
10+
11+
@Mixin(EntityRenderDispatcher.class)
12+
public class EntityRenderDispatcherMixin {
13+
14+
@Redirect(method = "method_10200", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;yaw:F"))
15+
public float freelook$yaw(Entity entity) {
16+
return Freelook.INSTANCE.yaw(entity.yaw);
17+
}
18+
19+
@Redirect(method = "method_10200", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;prevYaw:F"))
20+
public float freelook$prevYaw(Entity entity) {
21+
return Freelook.INSTANCE.yaw(entity.prevYaw);
22+
}
23+
24+
@Redirect(method = "method_10200", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;pitch:F"))
25+
public float freelook$pitch(Entity entity) {
26+
return Freelook.INSTANCE.pitch(entity.pitch);
27+
}
28+
29+
@Redirect(method = "method_10200", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;prevPitch:F"))
30+
public float freelook$prevPitch(Entity entity) {
31+
return Freelook.INSTANCE.pitch(entity.prevPitch);
32+
}
33+
34+
}

src/main/java/io/github/axolotlclient/mixin/GameRendererMixin.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.mojang.blaze3d.platform.GLX;
44
import com.mojang.blaze3d.platform.GlStateManager;
55
import io.github.axolotlclient.AxolotlClient;
6+
import io.github.axolotlclient.modules.freelook.Freelook;
67
import io.github.axolotlclient.modules.hud.HudManager;
78
import io.github.axolotlclient.modules.hud.gui.hud.CrosshairHud;
89
import io.github.axolotlclient.modules.motionblur.MotionBlur;
@@ -18,6 +19,8 @@
1819
import net.minecraft.entity.Entity;
1920
import net.minecraft.entity.LivingEntity;
2021
import net.minecraft.entity.effect.StatusEffect;
22+
import net.minecraft.entity.player.ClientPlayerEntity;
23+
2124
import org.lwjgl.opengl.GL11;
2225
import org.lwjgl.opengl.GLContext;
2326
import org.objectweb.asm.Opcodes;
@@ -176,4 +179,33 @@ public void motionBlur(float tickDelta, long nanoTime, CallbackInfo ci){
176179

177180
this.client.profiler.pop();
178181
}
182+
183+
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/ClientPlayerEntity;increaseTransforms(FF)V"))
184+
public void updateFreelook(ClientPlayerEntity entity, float yaw, float pitch) {
185+
Freelook freelook = Freelook.INSTANCE;
186+
187+
if(freelook.consumeRotation(yaw, pitch)) return;
188+
189+
entity.increaseTransforms(yaw, pitch);
190+
}
191+
192+
@Redirect(method = "transformCamera", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;yaw:F"))
193+
public float freelook$yaw(Entity entity) {
194+
return Freelook.INSTANCE.yaw(entity.yaw);
195+
}
196+
197+
@Redirect(method = "transformCamera", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;prevYaw:F"))
198+
public float freelook$prevYaw(Entity entity) {
199+
return Freelook.INSTANCE.yaw(entity.prevYaw);
200+
}
201+
202+
@Redirect(method = "transformCamera", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;pitch:F"))
203+
public float freelook$pitch(Entity entity) {
204+
return Freelook.INSTANCE.pitch(entity.pitch);
205+
}
206+
207+
@Redirect(method = "transformCamera", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;prevPitch:F"))
208+
public float freelook$prevPitch(Entity entity) {
209+
return Freelook.INSTANCE.pitch(entity.prevPitch);
210+
}
179211
}

src/main/java/io/github/axolotlclient/mixin/HandledScreenMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public abstract class HandledScreenMixin {
1818
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/GlStateManager;popMatrix()V"))
1919
public void resetScrollOnSlotChange(int mouseX, int mouseY, float tickDelta, CallbackInfo ci){
2020

21-
if(ScrollableTooltips.Instance.enabled.get() && cachedSlot != focusedSlot){
21+
if(ScrollableTooltips.instance.enabled.get() && cachedSlot != focusedSlot){
2222
cachedSlot = focusedSlot;
23-
ScrollableTooltips.Instance.resetScroll();
23+
ScrollableTooltips.instance.resetScroll();
2424
}
2525

2626
}

src/main/java/io/github/axolotlclient/mixin/MinecraftClientMixin.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,8 @@ public void tickClient(CallbackInfo ci){
123123
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lorg/lwjgl/input/Mouse;getEventDWheel()I"), remap = false)
124124
public int onScroll() {
125125
int amount = Mouse.getEventDWheel();
126-
if(amount != 0) {
127-
if(Zoom.scroll(amount)) {
128-
return 0;
129-
}
126+
if(amount != 0 && Zoom.scroll(amount)) {
127+
return 0;
130128
}
131129
return amount;
132130
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package io.github.axolotlclient.mixin;
2+
3+
import org.spongepowered.asm.mixin.Mixin;
4+
import org.spongepowered.asm.mixin.injection.At;
5+
import org.spongepowered.asm.mixin.injection.Redirect;
6+
7+
import io.github.axolotlclient.modules.freelook.Freelook;
8+
import net.minecraft.class_321;
9+
import net.minecraft.entity.player.PlayerEntity;
10+
11+
@Mixin(class_321.class)
12+
public class RenderDataMixin {
13+
14+
@Redirect(method = "method_804", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerEntity;yaw:F"))
15+
private static float freelook$getYaw(PlayerEntity entity) {
16+
return Freelook.INSTANCE.yaw(entity.yaw);
17+
}
18+
19+
@Redirect(method = "method_804", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerEntity;pitch:F"))
20+
private static float freelook$getPitch(PlayerEntity entity) {
21+
return Freelook.INSTANCE.pitch(entity.pitch);
22+
}
23+
24+
}

src/main/java/io/github/axolotlclient/mixin/ScreenMixin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ public abstract class ScreenMixin {
1717

1818
@ModifyArgs(method = "renderTooltip(Lnet/minecraft/item/ItemStack;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;renderTooltip(Ljava/util/List;II)V"))
1919
public void modifyTooltipPosition(Args args){
20-
if(ScrollableTooltips.Instance.enabled.get()) {
20+
if(ScrollableTooltips.instance.enabled.get()) {
2121

2222
if((MinecraftClient.getInstance().currentScreen instanceof CreativeInventoryScreen) &&
2323
((CreativeInventoryScreen)MinecraftClient.getInstance().currentScreen).getSelectedTab() != ItemGroup.INVENTORY.getIndex()){
2424
return;
2525
}
2626

27-
ScrollableTooltips.Instance.onRenderTooltip();
28-
args.set(1, (int)args.get(1) + ScrollableTooltips.Instance.tooltipOffsetX);
29-
args.set(2, (int)args.get(2) + ScrollableTooltips.Instance.tooltipOffsetY);
27+
ScrollableTooltips.instance.onRenderTooltip();
28+
args.set(1, (int)args.get(1) + ScrollableTooltips.instance.tooltipOffsetX);
29+
args.set(2, (int)args.get(2) + ScrollableTooltips.instance.tooltipOffsetY);
3030
}
3131
}
3232

0 commit comments

Comments
 (0)