Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e6d1bef
(feat) Animations: add SwingAnimations
minecrrrr May 23, 2026
7d9d0d1
fix(Animations): drop hand on swing
minecrrrr May 23, 2026
101efaa
fix(Animations): restore block animation 💀🔥✅
minecrrrr May 23, 2026
81b20ea
fix(Animations): correct item use, shield rendering, and hand drop on…
minecrrrr May 23, 2026
a3b9151
style(animations): reduce line 77 to satisfy detekt
minecrrrr May 23, 2026
c207776
feat(Animation): add more blocking animations
minecrrrr May 24, 2026
10aa2ba
fix: set "exploit preventer" version from 1.0.6+ to 1.0.6+26.1
minecrrrr May 24, 2026
d52128d
fix(Build): fix exploit preventer version resolving to incompatible b…
minecrrrr May 24, 2026
2655534
fix(Animation): remove swordblock dependency from swing animation
minecrrrr May 24, 2026
758bdc1
fix(Animation): remove swordblock dependency from swing animation
minecrrrr May 24, 2026
9a11afd
feat(Animation): add more blocking animations
minecrrrr May 24, 2026
3baf6c9
refactor(Animations): adjust Avatar X-position
minecrrrr May 24, 2026
5c48ba1
refactor(Animations): optimize blocking animations code
minecrrrr May 25, 2026
d47dd2d
Merge branch 'nextgen' into Swing-Animations
minecrrrr Jun 5, 2026
ed428ec
Merge branch 'CCBlueX:nextgen' into Swing-Animations
minecrrrr Jun 24, 2026
e857cd8
fix(animations): adapt swing animations and arm transform mixins to 2…
minecrrrr Aug 4, 2026
b8928e2
Merge branch 'CCBlueX:nextgen' into Swing-Animations
minecrrrr Aug 5, 2026
afd66b8
Merge branch 'CCBlueX:nextgen' into Swing-Animations
minecrrrr Aug 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import net.ccbluex.liquidbounce.features.module.modules.combat.elytratarget.ModuleElytraTarget;
import net.ccbluex.liquidbounce.features.module.modules.movement.*;
import net.ccbluex.liquidbounce.features.module.modules.render.DoRender;
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleAnimations;
import net.ccbluex.liquidbounce.features.module.modules.render.animations.ModuleAnimations;
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleAntiBlind;
import net.ccbluex.liquidbounce.features.module.modules.render.hitfx.ModuleHitFX;
import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.ModuleScaffold;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import net.ccbluex.liquidbounce.features.module.modules.combat.ModuleSwordBlock;
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleAnimations;
import net.ccbluex.liquidbounce.features.module.modules.render.animations.ModuleAnimations;
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleSilentHotbar;
import net.ccbluex.liquidbounce.features.module.modules.render.animations.SwingAnimations;
import net.ccbluex.liquidbounce.utils.client.SilentHotbar;
import net.ccbluex.liquidbounce.utils.item.ItemCategorizationsKt;
import net.ccbluex.liquidbounce.utils.render.FirstPersonShieldTint;
Expand All @@ -37,6 +38,7 @@
import net.minecraft.client.renderer.item.ItemStackRenderState;
import net.minecraft.core.component.DataComponents;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.HumanoidArm;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
Expand All @@ -46,10 +48,7 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.Slice;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

Expand Down Expand Up @@ -82,6 +81,34 @@ private void hookFirstPersonShieldTint(
original.call(instance, poseStack, submitNodeCollector, lightCoords, overlayCoords, outlineColor);
}

@Inject(
method = "swingArm",
at = @At("HEAD"),
cancellable = true
)
private void cancelVanillaSwing(
float attack,
PoseStack poseStack,
int invert,
HumanoidArm arm,
CallbackInfo ci
) {
AbstractClientPlayer player = Minecraft.getInstance().player;

if (player == null || !ModuleAnimations.INSTANCE.getRunning() || !SwingAnimations.INSTANCE.getEnabled() || ModuleSwordBlock.shouldAnimateSwordBlock(player)) {
return;
}

SwingAnimations.INSTANCE.onRenderItem(
player,
InteractionHand.MAIN_HAND,
attack,
poseStack
);

ci.cancel();
}

@Inject(method = "submitArmWithItem", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;pushPose()V", shift = At.Shift.AFTER))
private void hookRenderFirstPersonItem(
AbstractClientPlayer player, float frameInterp, float xRot, InteractionHand hand, float attack, ItemStack itemStack, float inverseArmHeight, PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, CallbackInfo ci) {
Expand Down Expand Up @@ -246,7 +273,6 @@ private int hookItemUseItem(int original, @Local(argsOnly = true, name = "player
if (ModuleSwordBlock.shouldAnimateSwordBlock(player)) {
return 7200;
}

return original;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ import net.ccbluex.liquidbounce.features.module.modules.player.cheststealer.Modu
import net.ccbluex.liquidbounce.features.module.modules.player.invcleaner.ModuleInventoryCleaner
import net.ccbluex.liquidbounce.features.module.modules.player.nofall.ModuleNoFall
import net.ccbluex.liquidbounce.features.module.modules.player.offhand.ModuleOffhand
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleAnimations
import net.ccbluex.liquidbounce.features.module.modules.render.animations.ModuleAnimations
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleAntiBlind
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleAspect
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleAutoF5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
* You should have received a copy of the GNU General Public License
* along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
*/
package net.ccbluex.liquidbounce.features.module.modules.render

package net.ccbluex.liquidbounce.features.module.modules.render.animations

import com.mojang.blaze3d.vertex.PoseStack
import com.mojang.math.Axis
Expand All @@ -28,9 +29,10 @@ import net.ccbluex.liquidbounce.event.events.PlayerStrideEvent
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.features.module.ClientModule
import net.ccbluex.liquidbounce.features.module.ModuleCategories
import net.ccbluex.liquidbounce.features.module.modules.combat.ModuleSwordBlock
import net.ccbluex.liquidbounce.utils.math.toRadians
import net.minecraft.util.Mth
import net.minecraft.world.entity.HumanoidArm
import org.joml.Quaternionf

/**
* Animations module
Expand All @@ -48,6 +50,7 @@ object ModuleAnimations : ClientModule("Animations", ModuleCategories.RENDER, al
tree(MainHand)
tree(OffHand)
tree(EquipOffset)
tree(SwingAnimations)
}

object MainHand : ToggleableValueGroup(this, "MainHand", false) {
Expand Down Expand Up @@ -75,10 +78,16 @@ object ModuleAnimations : ClientModule("Animations", ModuleCategories.RENDER, al
* of a sword.
* This choice is only used when the [ModuleSwordBlock] module is enabled.
*/

val swingAnimation = SwingAnimations
val blockAnimationChoice = choices(
"BlockingAnimation", OneSevenAnimation, arrayOf(
OneSevenAnimation,
PushdownAnimation
PushdownAnimation,
SigmaAnimation,
ExhibitionAnimation,
AvatarAnimation,
DortwareAnimation
)
)

Expand Down Expand Up @@ -116,6 +125,8 @@ object ModuleAnimations : ClientModule("Animations", ModuleCategories.RENDER, al
/**
* A choice that aims to transform the held item transformation during the swing progress.
*/


abstract class AnimationMode(name: String) : Mode(name) {

override val parent: ModeValueGroup<*>
Expand Down Expand Up @@ -176,4 +187,136 @@ object ModuleAnimations : ClientModule("Animations", ModuleCategories.RENDER, al

}

object SigmaAnimation : AnimationMode("Sigma") {

private val translateY by float("Y", 0.1f, 0.05f..0.3f)

override fun transform(matrices: PoseStack, arm: HumanoidArm, equipProgress: Float, swingProgress: Float) {

val sine = Mth.sin(Mth.sqrt(swingProgress) * Math.PI)
val sideM = if (arm == HumanoidArm.RIGHT) 1.0f else -1.0f

val rot = Quaternionf().rotationAxis(
(-sine * 27.5f * sideM).toRadians(),
-8.0f * sideM,
0.0f,
9.0f
).rotateAxis(
(-sine * 45.0f * sideM).toRadians(),
1.0f * sideM,
sine / 2.0f,
0.0f
)
matrices.mulPose(rot)

matrices.translate(0.0f, translateY, 0.0f)
applySwingOffset(matrices, arm, 0f)
}
}

object ExhibitionAnimation : AnimationMode("Exhibition") {

private val translateY by float("Y", 0.1f, 0.05f..0.3f)

override fun transform(matrices: PoseStack, arm: HumanoidArm, equipProgress: Float, swingProgress: Float) {

val sine = Mth.sin(Mth.sqrt(swingProgress) * Math.PI)
val sideM = if (arm == HumanoidArm.RIGHT) 1.0f else -1.0f

matrices.translate(0.0, -0.1, 0.0)

applySwingOffset(matrices, arm, 0f)

matrices.translate(0.1F, 0.4F, -0.1F)

val rot = Quaternionf().rotationAxis(
(-sine * 30.0F * sideM).toRadians(),
sine.div(2F),
0.0F,
9.0F
).rotateAxis(
(-sine * 50.0F * sideM).toRadians(),
0.8F * sideM,
sine.div(2F),
0F
)
matrices.mulPose(rot)

matrices.translate(0.0f, translateY - 0.2f, 0.0f)

}

}

object AvatarAnimation : AnimationMode("Avatar") {

private val translateY by float("Y", 0.1f, 0.05f..0.3f)

override fun transform(matrices: PoseStack, arm: HumanoidArm, equipProgress: Float, swingProgress: Float) {

val sine = Mth.sin(Mth.sqrt(swingProgress) * Math.PI)
val sine1 = Mth.sin(swingProgress * swingProgress * Math.PI)
val sideM = if (arm == HumanoidArm.RIGHT) 1.0f else -1.0f

matrices.translate(0.2F * sideM, translateY, 0F)

val rot = Quaternionf().rotationAxis(
(0.0F * sideM).toRadians(),
0.0F,
1.0F,
0.0F
).rotateY(
(sine1 * -20.0F * sideM).toRadians()
).rotateZ(
(sine * -20.0F * sideM).toRadians()
).rotateAxis(
(sine * -40.0F * sideM).toRadians(),
1.0F * sideM,
0.0F,
0.0F
)
matrices.mulPose(rot)

applySwingOffset(matrices, arm, 0f)
}
}

object DortwareAnimation : AnimationMode("Dortware") {

private val translateY by float("Y", 0.1f, 0.05f..0.3f)

override fun transform(matrices: PoseStack, arm: HumanoidArm, equipProgress: Float, swingProgress: Float) {

val sine = Mth.sin(Mth.sqrt(swingProgress) * Math.PI)
val sqrtSwing = Mth.sqrt(swingProgress)
val altSine = Mth.sin(sqrtSwing * Math.PI - 3)

val rot = Quaternionf().rotationAxis(
(-sine * 10).toRadians(),
0.0f,
15.0f,
200.0f
).rotateAxis(
(-sine * 10f).toRadians(),
300.0f,
sine.div(2f),
1.0f
)
matrices.mulPose(rot)

matrices.translate(3.4, 0.3, -0.4)
matrices.translate(-2.10f, -0.2f, 0.1f)

val rot1 = Quaternionf().rotationAxis(
(altSine * 13.0f).toRadians(),
-10.0f,
-1.4f,
-10.0f
)
matrices.mulPose(rot1)

matrices.translate(if(arm == HumanoidArm.RIGHT) -1f else -2f, translateY, 0f)

}
}
}
Loading