Skip to content

Commit b9496cf

Browse files
committed
add RotationLock option
sort translations alphabetically
1 parent 0245483 commit b9496cf

File tree

8 files changed

+1139
-1073
lines changed

8 files changed

+1139
-1073
lines changed

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

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,44 @@
2222

2323
package io.github.axolotlclient.mixin;
2424

25+
import java.nio.FloatBuffer;
26+
27+
import org.lwjgl.opengl.GL11;
28+
import org.lwjgl.opengl.GLContext;
29+
import org.objectweb.asm.Opcodes;
30+
import org.spongepowered.asm.mixin.Mixin;
31+
import org.spongepowered.asm.mixin.Shadow;
32+
import org.spongepowered.asm.mixin.injection.At;
33+
import org.spongepowered.asm.mixin.injection.At.Shift;
34+
import org.spongepowered.asm.mixin.injection.Inject;
35+
import org.spongepowered.asm.mixin.injection.Redirect;
36+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
37+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
38+
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
39+
2540
import com.mojang.blaze3d.platform.GLX;
2641
import com.mojang.blaze3d.platform.GlStateManager;
42+
2743
import io.github.axolotlclient.AxolotlClient;
2844
import io.github.axolotlclient.modules.freelook.Freelook;
2945
import io.github.axolotlclient.modules.hud.HudManager;
3046
import io.github.axolotlclient.modules.hud.gui.hud.vanilla.CrosshairHud;
47+
import io.github.axolotlclient.modules.hypixel.skyblock.Skyblock;
3148
import io.github.axolotlclient.modules.motionblur.MotionBlur;
3249
import io.github.axolotlclient.modules.sky.SkyboxManager;
3350
import io.github.axolotlclient.modules.zoom.Zoom;
34-
import io.github.axolotlclient.util.Util;
3551
import net.minecraft.block.Block;
3652
import net.minecraft.block.material.Material;
3753
import net.minecraft.client.MinecraftClient;
3854
import net.minecraft.client.MouseInput;
3955
import net.minecraft.client.options.GameOptions;
4056
import net.minecraft.client.render.Camera;
4157
import net.minecraft.client.render.GameRenderer;
42-
import net.minecraft.client.util.Window;
4358
import net.minecraft.enchantment.EnchantmentHelper;
4459
import net.minecraft.entity.Entity;
4560
import net.minecraft.entity.LivingEntity;
4661
import net.minecraft.entity.effect.StatusEffect;
4762
import net.minecraft.entity.player.ClientPlayerEntity;
48-
import org.lwjgl.opengl.GL11;
49-
import org.lwjgl.opengl.GLContext;
50-
import org.objectweb.asm.Opcodes;
51-
import org.spongepowered.asm.mixin.Mixin;
52-
import org.spongepowered.asm.mixin.Shadow;
53-
import org.spongepowered.asm.mixin.injection.At;
54-
import org.spongepowered.asm.mixin.injection.At.Shift;
55-
import org.spongepowered.asm.mixin.injection.Inject;
56-
import org.spongepowered.asm.mixin.injection.Redirect;
57-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
58-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
59-
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
60-
61-
import java.nio.FloatBuffer;
6263

6364
@Mixin(GameRenderer.class)
6465
public abstract class GameRendererMixin {
@@ -238,10 +239,10 @@ public void motionBlur(float tickDelta, long nanoTime, CallbackInfo ci) {
238239
}
239240

240241
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/ClientPlayerEntity;increaseTransforms(FF)V"))
241-
public void updateFreelook(ClientPlayerEntity entity, float yaw, float pitch) {
242+
public void updateRotation(ClientPlayerEntity entity, float yaw, float pitch) {
242243
Freelook freelook = Freelook.getInstance();
243244

244-
if (freelook.consumeRotation(yaw, pitch))
245+
if (freelook.consumeRotation(yaw, pitch) || Skyblock.getInstance().rotationLocked.get())
245246
return;
246247

247248
entity.increaseTransforms(yaw, pitch);

src/main/java/io/github/axolotlclient/modules/hypixel/HypixelMods.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import io.github.axolotlclient.modules.hypixel.autotip.AutoTip;
3333
import io.github.axolotlclient.modules.hypixel.levelhead.LevelHead;
3434
import io.github.axolotlclient.modules.hypixel.nickhider.NickHider;
35+
import io.github.axolotlclient.modules.hypixel.skyblock.Skyblock;
3536

3637
import java.util.ArrayList;
3738
import java.util.List;
@@ -57,6 +58,7 @@ public void init() {
5758
addSubModule(AutoTip.getInstance());
5859
addSubModule(NickHider.getInstance());
5960
addSubModule(AutoBoop.getInstance());
61+
addSubModule(Skyblock.getInstance());
6062

6163
subModules.forEach(AbstractHypixelMod::init);
6264

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright © 2021-2022 moehreag <[email protected]> & Contributors
3+
*
4+
* This file is part of AxolotlClient.
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*
20+
* For more information, see the LICENSE file.
21+
*/
22+
23+
package io.github.axolotlclient.modules.hypixel.skyblock;
24+
25+
import lombok.Getter;
26+
import org.lwjgl.input.Keyboard;
27+
28+
import io.github.axolotlclient.AxolotlclientConfig.options.BooleanOption;
29+
import io.github.axolotlclient.AxolotlclientConfig.options.KeyBindOption;
30+
import io.github.axolotlclient.AxolotlclientConfig.options.OptionCategory;
31+
import io.github.axolotlclient.modules.hypixel.AbstractHypixelMod;
32+
import net.minecraft.client.options.KeyBinding;
33+
34+
public class Skyblock implements AbstractHypixelMod {
35+
36+
@Getter
37+
private final static Skyblock Instance = new Skyblock();
38+
39+
private final OptionCategory category = new OptionCategory("axolotlclient.skyblock");
40+
41+
public final BooleanOption rotationLocked = new BooleanOption("axolotlclient.rotationLocked", false);
42+
private final KeyBindOption lock = new KeyBindOption("axolotlclient.lockRotation",
43+
new KeyBinding("axolotlclient.lockRotation", Keyboard.KEY_P, "category.axolotlclient"),
44+
keyBinding -> rotationLocked.toggle());
45+
46+
@Override
47+
public void init() {
48+
category.add(rotationLocked, lock);
49+
}
50+
51+
@Override
52+
public OptionCategory getCategory() {
53+
return category;
54+
}
55+
}

0 commit comments

Comments
 (0)