Skip to content

Commit

Permalink
feat(Aspect): Adjust the horizontal stretching (#5676)
Browse files Browse the repository at this point in the history
  • Loading branch information
sqlerrorthing authored Feb 24, 2025
1 parent 83b2779 commit 14c868f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import net.ccbluex.liquidbounce.event.EventManager;
import net.ccbluex.liquidbounce.event.events.GameRenderEvent;
Expand Down Expand Up @@ -59,7 +60,10 @@
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

@Mixin(GameRenderer.class)
public abstract class MixinGameRenderer {
Expand Down Expand Up @@ -285,4 +289,14 @@ private float injectShit(float original) {
return original;
}

@ModifyArgs(
method = "getBasicProjectionMatrix",
at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;perspective(FFFF)Lorg/joml/Matrix4f;")
)
private void hookBasicProjectionMatrix(Args args) {
if (ModuleAspect.INSTANCE.getRunning()) {
args.set(1, (float) args.get(1) / ModuleAspect.getRatioMultiplier());
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ object ModuleManager : EventListener, Iterable<ClientModule> by modules {
ModuleAttackEffects,
ModuleNametags,
ModuleCombineMobs,
ModuleAspect,
ModuleAutoF5,
ModuleChams,
ModuleBedPlates,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package net.ccbluex.liquidbounce.features.module.modules.render

import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.features.module.ClientModule

/**
* Aspect ratio changer
*
* @author sqlerrorthing
*/
@Suppress("MagicNumber")
object ModuleAspect : ClientModule("Aspect", Category.RENDER) {
private val ratioPercentage by int("Ratio", 100, 1..300, suffix = "%")

@JvmStatic
val ratioMultiplier: Float get() = ratioPercentage.toFloat() / 100f
}
1 change: 1 addition & 0 deletions src/main/resources/resources/liquidbounce/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@
"liquidbounce.module.targets.description": "Allows you to manage which entities are considered to be your target.",
"liquidbounce.module.esp.description": "Highlights all targets allowing you to see them through walls.",
"liquidbounce.module.fakeLag.description": "Holds back packets so as to prevent you from being hit by an enemy.",
"liquidbounce.module.aspect.description": "Adjust the horizontal stretching.",
"liquidbounce.module.fastBreak.description": "Allows you to break blocks faster.",
"liquidbounce.module.fastPlace.description": "Allows you to place blocks faster.",
"liquidbounce.module.fastUse.description": "Allows you to use items faster.",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/resources/liquidbounce/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@
"liquidbounce.module.packetLogger.messages.canceled": "Отмененные",
"liquidbounce.module.holeFiller.description": "Автоматически заполняет безопасные места для PvP с кристаллами.",
"liquidbounce.module.tpAura.description": "Автоматически телепортирует и атакует врагов вокруг.",
"liquidbounce.module.aspect.description": "Позволяет растягивать или сужать игру по горизонтали.",
"liquidbounce.module.packetMine.description": "Позволяет добывать блоки, щелкая по ним один раз.",
"liquidbounce.module.fastExp.description": "Автоматически чинит вашу броню.",
"liquidbounce.module.bookBot.description": "Автоматически пишет в книгах.",
Expand Down

0 comments on commit 14c868f

Please sign in to comment.