Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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 @@ -208,7 +208,7 @@ import net.ccbluex.liquidbounce.features.module.modules.render.ModuleHud
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleItemChams
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleItemESP
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleItemTags
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleJumpEffect
import net.ccbluex.liquidbounce.features.module.modules.render.jumpeffect.ModuleJumpEffect
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleLogoffSpot
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleMobOwners
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleNewChunks
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2015 - 2026 CCBlueX
*
* LiquidBounce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiquidBounce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.jumpeffect

import net.ccbluex.liquidbounce.config.types.group.ValueGroup
import net.ccbluex.liquidbounce.render.engine.type.Color4b

class JumpEffectColorSettings : ValueGroup("Colors") {

val innerColor by color("InnerColor", Color4b(0, 255, 4, 0))
val outerColor by color("OuterColor", Color4b(0, 255, 4, 89))

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2015 - 2026 CCBlueX
*
* LiquidBounce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiquidBounce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.jumpeffect

import net.ccbluex.liquidbounce.config.types.group.Mode
import net.ccbluex.liquidbounce.config.types.group.ModeValueGroup
import net.ccbluex.liquidbounce.event.events.PlayerJumpEvent
import net.ccbluex.liquidbounce.event.events.WorldRenderEvent
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.features.module.modules.render.jumpeffect.ModuleJumpEffect.modes
import net.ccbluex.liquidbounce.render.WorldRenderEnvironment
import net.ccbluex.liquidbounce.render.engine.type.Color4b
import net.ccbluex.liquidbounce.render.renderEnvironment
import net.ccbluex.liquidbounce.render.utils.shiftHue
import net.ccbluex.liquidbounce.render.withPositionRelativeToCamera
import net.ccbluex.liquidbounce.render.withPush
import net.ccbluex.liquidbounce.utils.collection.ExpiringList.Companion.ExpiringList
import net.ccbluex.liquidbounce.utils.math.Easing
import net.minecraft.world.phys.Vec3

abstract class JumpEffectMode(name: String) : Mode(name) {
final override val parent: ModeValueGroup<*>
get() = modes

val endRadius by floatRange("EndRadius", 0.15F..0.8F, 0F..3F)
Comment thread
MukjepScarlet marked this conversation as resolved.
Outdated

val animCurve by easing("AnimCurve", Easing.QUAD_OUT)

val hueOffsetAnim by int("HueOffsetAnim", 63, -360..360)

val lifetime by intRange("Lifetime", 15..15, 1..120, "anim/life")
val canBeCovered by boolean("CanBeCovered", false)

val circles = ExpiringList<Vec3>()

protected abstract fun WorldRenderEnvironment.drawJumpEffect(progress: Float, age: Float)

@Suppress("unused")
private val renderHandler = handler<WorldRenderEvent> { event ->
event.renderEnvironment {
circles.forEach {

val age = lifetime.last - circles.timeToDie(it) + event.partialTicks

val progress = animCurve
.transform(age / lifetime.first)
.coerceIn(0f, 1f)

withPositionRelativeToCamera(it.value) {
poseStack.withPush {
drawJumpEffect(progress, age)
}
}
}
}
}

fun animateColor(baseColor: Color4b, age: Float): Color4b {
val fadeProgress = when {
lifetime.last > lifetime.first ->
((age - lifetime.first) / (lifetime.last - lifetime.first).toFloat()).coerceIn(0f, 1f)
else -> (age / lifetime.last.toFloat()).coerceIn(0f, 1f)

}

val color = baseColor.fade(1.0f - fadeProgress)

if (hueOffsetAnim == 0) {
return color
}

val lifeProgress = (age / lifetime.last.toFloat()).coerceIn(0f, 1f)
return shiftHue(color, (hueOffsetAnim * lifeProgress).toInt())
}

@Suppress("unused")
val playerJumpHandler = handler<PlayerJumpEvent> { _ ->
// Adds new circle when the player jumps
circles.add(player.position(), lifetime.last)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2015 - 2026 CCBlueX
*
* LiquidBounce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiquidBounce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.jumpeffect

import net.ccbluex.liquidbounce.features.module.ClientModule
import net.ccbluex.liquidbounce.features.module.ModuleCategories
import net.ccbluex.liquidbounce.features.module.modules.render.jumpeffect.modes.JumpEffectImage
import net.ccbluex.liquidbounce.features.module.modules.render.jumpeffect.modes.JumpEffectStandard

object ModuleJumpEffect : ClientModule("JumpEffect", ModuleCategories.RENDER) {

val modes = choices("Mode", 0) {
arrayOf(
JumpEffectStandard,
JumpEffectImage
)
}.apply { tagBy(this) }

override fun onDisabled() {
modes.modes.forEach { mode ->
Comment thread
minecrrrr marked this conversation as resolved.
Outdated
mode.circles.clear()
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2015 - 2026 CCBlueX
*
* LiquidBounce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiquidBounce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.jumpeffect.modes

import com.mojang.math.Axis
import net.ccbluex.fastutil.toEnumSet
import net.ccbluex.liquidbounce.LiquidBounce
import net.ccbluex.liquidbounce.config.utils.TextureMode
import net.ccbluex.liquidbounce.features.module.modules.render.jumpeffect.JumpEffectColorSettings
import net.ccbluex.liquidbounce.features.module.modules.render.jumpeffect.JumpEffectMode
import net.ccbluex.liquidbounce.render.AnchorPoint
import net.ccbluex.liquidbounce.render.WorldRenderEnvironment
import net.ccbluex.liquidbounce.render.drawSquareTextureGradient
import net.ccbluex.liquidbounce.render.withPush
import net.ccbluex.liquidbounce.utils.render.asTexture
import net.ccbluex.liquidbounce.utils.render.readNativeImage

internal object JumpEffectImage : JumpEffectMode("Image") {

private val colors = JumpEffectColorSettings()
private val rotationSpeed by int("RotationSpeed", 10, -360..360)

private val textureMode = modes("Source", 0) {
arrayOf(
TextureMode.Builtin(it, PresetTexture.LIQUIDBOUNCE, PresetTexture.entries.toEnumSet()),
Comment thread
MukjepScarlet marked this conversation as resolved.
Outdated
TextureMode.Custom(it),
)
}

init {
tree(colors)
}

override fun WorldRenderEnvironment.drawJumpEffect(progress: Float, age: Float) {
val texture = textureMode.activeMode.texture ?: return
poseStack.withPush {
val currentRotation = rotationSpeed * age

mulPose(Axis.XP.rotationDegrees(90f))
mulPose(Axis.ZP.rotationDegrees(currentRotation))
drawSquareTextureGradient(
Comment thread
minecrrrr marked this conversation as resolved.
sampler0 = texture,
outerRadius = endRadius.endInclusive * progress,
innerRadius = endRadius.start * progress,
animateColor(colors.outerColor, age),
animateColor(colors.innerColor, age),
anchor = AnchorPoint.CENTER,
startOffset = 0.8f
)
}
}

private enum class PresetTexture(override val tag: String, val path: String) : TextureMode.Builtin.Preset {
LIQUIDBOUNCE("Liquidbounce", "jump_effect/liquidbounce.png"),
LIQUIDBOUNCELOGO("LiquidbounceWithLogo", "jump_effect/liquidbounce_with_logo.png");

override val texture = LiquidBounce.resource(this.path)
.readNativeImage().asTexture { "JumpEffect Image $tag" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2015 - 2026 CCBlueX
*
* LiquidBounce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiquidBounce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.jumpeffect.modes

import net.ccbluex.liquidbounce.features.module.modules.render.jumpeffect.JumpEffectColorSettings
import net.ccbluex.liquidbounce.features.module.modules.render.jumpeffect.JumpEffectMode
import net.ccbluex.liquidbounce.render.WorldRenderEnvironment
import net.ccbluex.liquidbounce.render.drawGradientCircle

internal object JumpEffectStandard : JumpEffectMode("Standard") {

private val colors = JumpEffectColorSettings()

init {
tree(colors)
}

override fun WorldRenderEnvironment.drawJumpEffect(progress: Float, age: Float) {
drawGradientCircle(
endRadius.endInclusive * progress,
endRadius.start * progress,
animateColor(colors.outerColor, age),
animateColor(colors.innerColor, age),
noDepthTest = !canBeCovered
)
}
}
Loading