diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/AutoPot.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/AutoPot.kt index b28f764e572..abfa15dfa66 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/AutoPot.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/AutoPot.kt @@ -52,12 +52,9 @@ object AutoPot : Module("AutoPot", Category.COMBAT, hideModule = false) { private val mode by ListValue("Mode", arrayOf("Normal", "Jump", "Port"), "Normal") private val options = RotationSettings(this).withoutKeepRotation().apply { - rotationModeValue.set("On") - applyServerSideValue.isSupported = { false } applyServerSideValue.note = BoolValue.NoteType.HIDE resetTicksValue.isSupported = { false } - rotationModeValue.isSupported = { false } immediate = true } diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/ProjectileAimbot.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/ProjectileAimbot.kt index 2eb50716a07..bca61f527ea 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/ProjectileAimbot.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/ProjectileAimbot.kt @@ -52,10 +52,7 @@ object ProjectileAimbot : Module("ProjectileAimbot", Category.COMBAT, hideModule private val predictSize by FloatValue("PredictSize", 2F, 0.1F..5F) { predict && gravityType == "Projectile"} - private val options = RotationSettings(this).withoutKeepRotation().apply { - rotationModeValue.set("On") - rotationModeValue.isSupported = { false } - } + private val options = RotationSettings(this).withoutKeepRotation() private val randomizeRotations by BoolValue("RandomizeRotations", false) { options.rotationsActive } diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/misc/NoRotateSet.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/misc/NoRotateSet.kt index 9ce9b2ab059..64d45c9e58f 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/misc/NoRotateSet.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/misc/NoRotateSet.kt @@ -22,8 +22,6 @@ object NoRotateSet : Module("NoRotateSet", Category.MISC, gameDetecting = false, val affectRotation by BoolValue("AffectRotation", true) private val options = RotationSettings(this) { affectRotation }.apply { - rotationModeValue.set("On") - rotationModeValue.isSupported = { false } applyServerSideValue.isSupported = { false } applyServerSideValue.note = BoolValue.NoteType.HIDE resetTicksValue.isSupported = { false } diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/render/BedPlates.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/render/BedPlates.kt index 5c5be211fe5..fa064ff1356 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/render/BedPlates.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/render/BedPlates.kt @@ -231,7 +231,6 @@ object BedPlates : Module("BedPlates", Category.RENDER, hideModule = false) { backgroundMode == "Gradient", gradientX, gradientY, - maxBackgroundGradientColors, bgGradColors.toColorArray(maxBackgroundGradientColors), gradientBackgroundSpeed, gradientOffset @@ -257,7 +256,6 @@ object BedPlates : Module("BedPlates", Category.RENDER, hideModule = false) { textMode == "Gradient", gradientX, gradientY, - maxTextGradientColors, textGradColors.toColorArray(maxTextGradientColors), gradientTextSpeed, gradientOffset diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/world/scaffolds/Scaffold.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/world/scaffolds/Scaffold.kt index 407636e0514..99d4c91e9bb 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/world/scaffolds/Scaffold.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/world/scaffolds/Scaffold.kt @@ -46,9 +46,7 @@ import net.minecraft.util.* import net.minecraft.world.WorldSettings import net.minecraftforge.event.ForgeEventFactory import org.lwjgl.input.Keyboard -import org.lwjgl.opengl.GL11 import java.awt.Color -import javax.vecmath.Color3f import kotlin.math.* object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule = false) { @@ -225,9 +223,10 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule ) { eagleValue.isSupported() && eagle != "Off" } // Rotation Options - private val options = RotationSettings(this).apply { + private val modeList = ListValue("Rotations", arrayOf("Off", "Normal", "Stabilized", "GodBridge"), "Normal") + + private val options = RotationSettingsWithRotationModes(this, modeList).apply { strictValue.isSupported = { false } - rotationModeValue.values = arrayOf("Off", "Normal", "Stabilized", "GodBridge") resetTicksValue.setSupport { { it && scaffoldMode != "Telly" } } } @@ -296,7 +295,6 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule // Visuals private val mark by BoolValue("Mark", false, subjective = true) private val trackCPS by BoolValue("TrackCPS", false, subjective = true) - private val safetyLines by BoolValue("SafetyLines", false, subjective = true) { isGodBridgeEnabled } // Target placement var placeRotation: PlaceRotation? = null @@ -819,6 +817,8 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule TickScheduler += { serverSlot = player.inventory.currentItem } + + options.instant = false } // Entity movement event @@ -868,8 +868,6 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule } } - displaySafetyLinesIfEnabled() - if (!mark) { return } @@ -909,6 +907,8 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule ): Boolean { val player = mc.thePlayer ?: return false + options.instant = false + if (!isReplaceable(blockPosition)) { if (autoF5) mc.gameSettings.thirdPersonView = 0 return false @@ -954,15 +954,15 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule placeRotation ?: return false if (options.rotationsActive && !isGodBridgeEnabled) { - val rotationDifference = rotationDifference(placeRotation.rotation, currRotation) - val (hSpeed, vSpeed) = options.horizontalSpeed.random() to options.verticalSpeed.random() - val (factorH, factorV) = if (options.smootherMode == "Relative") - computeFactor(rotationDifference, hSpeed) to computeFactor(rotationDifference, vSpeed) - else hSpeed to vSpeed - - options.instant = blockSafe && rotationDifference > (factorH + factorV) / 2f - - setRotation(placeRotation.rotation, if (scaffoldMode == "Telly") 1 else options.resetTicks) + val rotationDifference = rotationDifference(placeRotation.rotation, currRotation) + val (hSpeed, vSpeed) = options.horizontalSpeed.random() to options.verticalSpeed.random() + val (factorH, factorV) = if (options.smootherMode == "Relative") + computeFactor(rotationDifference, hSpeed) to computeFactor(rotationDifference, vSpeed) + else hSpeed to vSpeed + + options.instant = blockSafe && rotationDifference > (factorH + factorV) / 2f + + setRotation(placeRotation.rotation, if (scaffoldMode == "Telly") 1 else options.resetTicks) } this.placeRotation = placeRotation @@ -1102,105 +1102,6 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule } } - private fun displaySafetyLinesIfEnabled() { - if (!safetyLines || !isGodBridgeEnabled) { - return - } - - val player = mc.thePlayer ?: return - - // If player is not walking diagonally then continue - if (round(abs(MathHelper.wrapAngleTo180_float(player.rotationYaw)).roundToInt() / 45f) * 45f !in arrayOf( - 135f, - 45f - ) || player.movementInput.moveForward == 0f || player.movementInput.moveStrafe != 0f - ) { - val (posX, posY, posZ) = player.interpolatedPosition() - - GL11.glPushMatrix() - GL11.glTranslated(-posX, -posY, -posZ) - GL11.glLineWidth(5.5f) - GL11.glDisable(GL11.GL_TEXTURE_2D) - - val (yawX, yawZ) = player.horizontalFacing.directionVec.x * 1.5 to player.horizontalFacing.directionVec.z * 1.5 - - // The target rotation will either be the module's placeRotation or a forced rotation (usually that's where the GodBridge mode aims) - val targetRotation = run { - val yaw = floatArrayOf(-135f, -45f, 45f, 135f).minByOrNull { - abs( - RotationUtils.angleDifference( - it, - MathHelper.wrapAngleTo180_float(currRotation.yaw) - ) - ) - } ?: return - - placeRotation?.rotation ?: Rotation(yaw, 73f) - } - - // Calculate color based on rotation difference - val color = getColorForRotationDifference( - rotationDifference( - targetRotation, - currRotation - ) - ) - - val main = BlockPos(player).down() - - val pos = if (canBeClicked(main)) { - main - } else { - (-1..1).flatMap { x -> - (-1..1).map { z -> - val neighbor = main.add(x, 0, z) - - neighbor to BlockUtils.getCenterDistance(neighbor) - } - }.filter { canBeClicked(it.first) }.minByOrNull { it.second }?.first ?: main - }.up().getVec() - - for (offset in 0..1) { - for (i in -1..1 step 2) { - for (x1 in 0.25..0.5 step 0.01) { - val opposite = offset == 1 - - val (offsetX, offsetZ) = if (opposite) 0.0 to x1 * i else x1 * i to 0.0 - val (lineX, lineZ) = if (opposite) yawX to 0.0 else 0.0 to yawZ - - val (x, y, z) = pos.add(Vec3(offsetX, -0.99, offsetZ)) - - GL11.glBegin(GL11.GL_LINES) - - GL11.glColor3f(color.x, color.y, color.z) - GL11.glVertex3d(x - lineX, y + 0.5, z - lineZ) - GL11.glVertex3d(x + lineX, y + 0.5, z + lineZ) - - GL11.glEnd() - } - } - } - GL11.glEnable(GL11.GL_TEXTURE_2D) - GL11.glPopMatrix() - } - } - - private fun getColorForRotationDifference(rotationDifference: Float): Color3f { - val maxDifferenceForGreen = 10.0f - val maxDifferenceForYellow = 40.0f - - val interpolationFactor = when { - rotationDifference <= maxDifferenceForGreen -> 0.0f - rotationDifference <= maxDifferenceForYellow -> (rotationDifference - maxDifferenceForGreen) / (maxDifferenceForYellow - maxDifferenceForGreen) - else -> 1.0f - } - - val green = 1.0f - interpolationFactor - val blue = 0.0f - - return Color3f(interpolationFactor, green, blue) - } - private fun updatePlacedBlocksForTelly() { if (blocksUntilAxisChange > horizontalPlacements + verticalPlacements) { blocksUntilAxisChange = 0 diff --git a/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiInGame.java b/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiInGame.java index de552167070..b3e947d16fc 100644 --- a/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiInGame.java +++ b/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiInGame.java @@ -12,7 +12,9 @@ import net.ccbluex.liquidbounce.features.module.modules.render.NoScoreboard; import net.ccbluex.liquidbounce.ui.font.AWTFontRenderer; import net.ccbluex.liquidbounce.utils.ClassUtils; -import net.ccbluex.liquidbounce.utils.render.*; +import net.ccbluex.liquidbounce.utils.render.ColorSettingsKt; +import net.ccbluex.liquidbounce.utils.render.FakeItemRender; +import net.ccbluex.liquidbounce.utils.render.RenderUtils; import net.ccbluex.liquidbounce.utils.render.shader.shaders.GradientShader; import net.ccbluex.liquidbounce.utils.render.shader.shaders.RainbowShader; import net.minecraft.client.Minecraft; @@ -27,7 +29,10 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +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.callback.CallbackInfo; @@ -68,7 +73,9 @@ public abstract class MixinGuiInGame extends Gui { @Shadow protected abstract void renderHotbarItem(int index, int xPos, int yPos, float partialTicks, EntityPlayer player); - @Shadow @Final protected Minecraft mc; + @Shadow + @Final + protected Minecraft mc; @Inject(method = "renderScoreboard", at = @At("HEAD"), cancellable = true) private void renderScoreboard(CallbackInfo callbackInfo) { @@ -158,7 +165,6 @@ protected void renderTooltip(ScaledResolution sr, float partialTicks) { true, gradientX, gradientY, - hud.getMaxHotbarGradientColors(), gradientColors, hud.getGradientHotbarSpeed(), gradientOffset diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Arraylist.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Arraylist.kt index 6ebcd14b811..8c30d641146 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Arraylist.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Arraylist.kt @@ -257,7 +257,6 @@ class Arraylist( !markAsInactive && backgroundMode == "Gradient", gradientX, gradientY, - maxBackgroundGradientColors, bgGradColors.toColorArray(maxBackgroundGradientColors), gradientBackgroundSpeed, gradientOffset @@ -283,7 +282,6 @@ class Arraylist( !markAsInactive && textColorMode == "Gradient", gradientX, gradientY, - maxTextGradientColors, textGradColors.toColorArray(maxTextGradientColors), gradientTextSpeed, gradientOffset @@ -311,7 +309,6 @@ class Arraylist( !markAsInactive && isCustomRectGradientSupported, gradientX, gradientY, - maxRectGradientColors, rectGradColors.toColorArray(maxRectGradientColors), gradientRectSpeed, gradientOffset @@ -384,7 +381,6 @@ class Arraylist( !markAsInactive && backgroundMode == "Gradient", gradientX, gradientY, - maxBackgroundGradientColors, bgGradColors.toColorArray(maxBackgroundGradientColors), gradientBackgroundSpeed, gradientOffset @@ -407,7 +403,6 @@ class Arraylist( !markAsInactive && textColorMode == "Gradient", gradientX, gradientY, - maxTextGradientColors, textGradColors.toColorArray(maxTextGradientColors), gradientTextSpeed, gradientOffset @@ -436,7 +431,6 @@ class Arraylist( !markAsInactive && isCustomRectGradientSupported, gradientX, gradientY, - maxRectGradientColors, rectGradColors.toColorArray(maxRectGradientColors), gradientRectSpeed, gradientOffset diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/BlockCounter.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/BlockCounter.kt index 8c84230a624..32a926b9c4c 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/BlockCounter.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/BlockCounter.kt @@ -82,7 +82,6 @@ class BlockCounter(x: Double = 520.0, y: Double = 245.0) : Element(x = x, y = y) GradientShader.begin(backgroundMode == "Gradient", gradientX, gradientY, - maxBackgroundGradientColors, bgGradColors.toColorArray(maxBackgroundGradientColors), gradientBackgroundSpeed, gradientOffset @@ -103,7 +102,6 @@ class BlockCounter(x: Double = 520.0, y: Double = 245.0) : Element(x = x, y = y) GradientFontShader.begin(textColorMode == "Gradient", gradientX, gradientY, - maxTextGradientColors, textGradColors.toColorArray(maxTextGradientColors), gradientTextSpeed, gradientOffset diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Text.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Text.kt index c9312baaeda..3b9f44e91ff 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Text.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Text.kt @@ -26,7 +26,6 @@ import net.ccbluex.liquidbounce.utils.render.ColorSettingsFloat import net.ccbluex.liquidbounce.utils.render.ColorSettingsInteger import net.ccbluex.liquidbounce.utils.render.ColorUtils import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRoundedBorder -import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRoundedBorderRect import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawRoundedRect import net.ccbluex.liquidbounce.utils.render.shader.shaders.GradientFontShader import net.ccbluex.liquidbounce.utils.render.shader.shaders.GradientShader @@ -277,7 +276,6 @@ class Text(x: Double = 10.0, y: Double = 10.0, scale: Float = 1F, side: Side = S backgroundMode == "Gradient", gradientX, gradientY, - maxBackgroundGradientColors, bgGradColors.toColorArray(maxBackgroundGradientColors), gradientBackgroundSpeed, gradientOffset @@ -335,7 +333,6 @@ class Text(x: Double = 10.0, y: Double = 10.0, scale: Float = 1F, side: Side = S GradientFontShader.begin(gradient, gradientX, gradientY, - maxTextGradientColors, textGradColors.toColorArray(maxTextGradientColors), gradientTextSpeed, gradientOffset diff --git a/src/main/java/net/ccbluex/liquidbounce/utils/ClassUtils.kt b/src/main/java/net/ccbluex/liquidbounce/utils/ClassUtils.kt index a3f0161b3aa..440b602ce5a 100644 --- a/src/main/java/net/ccbluex/liquidbounce/utils/ClassUtils.kt +++ b/src/main/java/net/ccbluex/liquidbounce/utils/ClassUtils.kt @@ -49,6 +49,26 @@ object ClassUtils { } } + val superclass = element::class.java.superclass + + /** + * For classes with values that include their value-containing super classes + * + * Example: class ClassWithValues() : OriginalClassWithValues() + */ + if (superclass?.`package`?.name?.contains("liquidbounce") == true && !Value::class.java.isAssignableFrom(superclass)) { + superclass.declaredFields.forEach { + it.isAccessible = true + val fieldValue = it[element] ?: return@forEach + + if (fieldValue is Value<*>) { + list += fieldValue + } else { + findValues(fieldValue, configurables, list) + } + } + } + element.javaClass.declaredFields.forEach { it.isAccessible = true val fieldValue = it[element] ?: return@forEach diff --git a/src/main/java/net/ccbluex/liquidbounce/utils/RotationSettings.kt b/src/main/java/net/ccbluex/liquidbounce/utils/RotationSettings.kt index d432550a000..84809b65675 100644 --- a/src/main/java/net/ccbluex/liquidbounce/utils/RotationSettings.kt +++ b/src/main/java/net/ccbluex/liquidbounce/utils/RotationSettings.kt @@ -12,9 +12,10 @@ import net.ccbluex.liquidbounce.value.IntegerValue import net.ccbluex.liquidbounce.value.ListValue @Suppress("MemberVisibilityCanBePrivate") -class RotationSettings(owner: Module, generalApply: () -> Boolean = { true }) { +open class RotationSettings(owner: Module, generalApply: () -> Boolean = { true }) { + + open val rotationsValue = BoolValue("Rotations", true) { generalApply() } - var rotationModeValue = ListValue("Rotations", arrayOf("Off", "On"), "On") { generalApply() } val smootherModeValue = ListValue("SmootherMode", arrayOf("Linear", "Relative"), "Relative" @@ -23,7 +24,9 @@ class RotationSettings(owner: Module, generalApply: () -> Boolean = { true }) { val simulateShortStopValue = BoolValue("SimulateShortStop", false) { rotationsActive && generalApply() } val strafeValue = BoolValue("Strafe", false) { rotationsActive && applyServerSide && generalApply() } val strictValue = BoolValue("Strict", false) { strafeValue.isActive() && generalApply() } - val keepRotationValue = BoolValue("KeepRotation", true) { rotationsActive && applyServerSide && generalApply() } + val keepRotationValue = BoolValue("KeepRotation", + true + ) { rotationsActive && applyServerSide && generalApply() } val resetTicksValue = object : IntegerValue("ResetTicks", 1, 1..20) { override fun onChange(oldValue: Int, newValue: Int) = newValue.coerceAtLeast(minimum) override fun isSupported() = rotationsActive && applyServerSide && generalApply() @@ -34,12 +37,18 @@ class RotationSettings(owner: Module, generalApply: () -> Boolean = { true }) { false ) { rotationsActive && generalApply() } val useStraightLinePathValue = BoolValue("UseStraightLinePath", true) { rotationsActive && generalApply() } - val maxHorizontalAngleChangeValue: FloatValue = object : FloatValue("MaxHorizontalAngleChange", 180f, 1f..180f) { + val maxHorizontalAngleChangeValue: FloatValue = object : FloatValue("MaxHorizontalAngleChange", + 180f, + 1f..180f + ) { override fun onChange(oldValue: Float, newValue: Float) = newValue.coerceAtLeast(minHorizontalAngleChange) override fun isSupported() = rotationsActive && generalApply() } - val minHorizontalAngleChangeValue: FloatValue = object : FloatValue("MinHorizontalAngleChange", 180f, 1f..180f) { + val minHorizontalAngleChangeValue: FloatValue = object : FloatValue("MinHorizontalAngleChange", + 180f, + 1f..180f + ) { override fun onChange(oldValue: Float, newValue: Float) = newValue.coerceAtMost(maxHorizontalAngleChange) override fun isSupported() = !maxHorizontalAngleChangeValue.isMinimal() && rotationsActive && generalApply() } @@ -65,7 +74,7 @@ class RotationSettings(owner: Module, generalApply: () -> Boolean = { true }) { ) { rotationsActive && generalApply() } // Variables for easier access - val rotationMode by rotationModeValue + val rotations by rotationsValue val smootherMode by smootherModeValue val applyServerSide by applyServerSideValue val simulateShortStop by simulateShortStopValue @@ -87,8 +96,8 @@ class RotationSettings(owner: Module, generalApply: () -> Boolean = { true }) { var immediate = false var instant = false - val rotationsActive - get() = rotationMode != "Off" + open val rotationsActive + get() = rotations val horizontalSpeed get() = minHorizontalAngleChange..maxHorizontalAngleChange @@ -102,6 +111,25 @@ class RotationSettings(owner: Module, generalApply: () -> Boolean = { true }) { return this } + init { + owner.addConfigurable(this) + } +} + +class RotationSettingsWithRotationModes( + owner: Module, listValue: ListValue, generalApply: () -> Boolean = { true }, +) : RotationSettings(owner, generalApply) { + + override val rotationsValue: BoolValue + get() = super.rotationsValue.apply { isSupported = { false } } + + val rotationModeValue = listValue.apply { isSupported = generalApply } + + val rotationMode by rotationModeValue + + override val rotationsActive: Boolean + get() = rotationMode != "Off" + init { owner.addConfigurable(this) } diff --git a/src/main/java/net/ccbluex/liquidbounce/utils/RotationUtils.kt b/src/main/java/net/ccbluex/liquidbounce/utils/RotationUtils.kt index 53725d77f17..212f9a5b276 100644 --- a/src/main/java/net/ccbluex/liquidbounce/utils/RotationUtils.kt +++ b/src/main/java/net/ccbluex/liquidbounce/utils/RotationUtils.kt @@ -23,7 +23,7 @@ object RotationUtils : MinecraftInstance(), Listenable { /** * Our final rotation point, which [currentRotation] follows. */ - private var targetRotation: Rotation? = null + var targetRotation: Rotation? = null /** * The current rotation that is responsible for aiming at objects, synchronizing movement, etc. diff --git a/src/main/java/net/ccbluex/liquidbounce/utils/render/shader/shaders/GradientFontShader.kt b/src/main/java/net/ccbluex/liquidbounce/utils/render/shader/shaders/GradientFontShader.kt index 940cd9b1aff..a535d49bff4 100644 --- a/src/main/java/net/ccbluex/liquidbounce/utils/render/shader/shaders/GradientFontShader.kt +++ b/src/main/java/net/ccbluex/liquidbounce/utils/render/shader/shaders/GradientFontShader.kt @@ -20,7 +20,7 @@ object GradientFontShader : Shader("gradient_font_shader.frag"), Closeable { var offset = 0f var speed = 1f - var maxColors = 4 + var maxColors = 9 var colors: Array = Array(maxColors) { floatArrayOf(0f, 0f, 0f, 1f) } override fun setupUniforms() { @@ -68,11 +68,11 @@ object GradientFontShader : Shader("gradient_font_shader.frag"), Closeable { stopShader() } - fun begin(enable: Boolean, x: Float, y: Float, maxColors: Int, gradient: List, speed: Float, offset: Float): GradientFontShader { + fun begin(enable: Boolean, x: Float, y: Float, gradient: List, speed: Float, offset: Float): GradientFontShader { if (enable) { strengthX = x strengthY = y - this.maxColors = maxColors + this.maxColors = gradient.size colors = gradient.toTypedArray() this.speed = speed this.offset = offset diff --git a/src/main/java/net/ccbluex/liquidbounce/utils/render/shader/shaders/GradientShader.kt b/src/main/java/net/ccbluex/liquidbounce/utils/render/shader/shaders/GradientShader.kt index 2530d310e1a..a295e68e74f 100644 --- a/src/main/java/net/ccbluex/liquidbounce/utils/render/shader/shaders/GradientShader.kt +++ b/src/main/java/net/ccbluex/liquidbounce/utils/render/shader/shaders/GradientShader.kt @@ -69,11 +69,11 @@ object GradientShader : Shader("gradient_shader.frag"), Closeable { } @JvmStatic - fun begin(enable: Boolean, x: Float, y: Float, maxColors: Int, gradient: List, speed: Float, offset: Float): GradientShader { + fun begin(enable: Boolean, x: Float, y: Float, gradient: List, speed: Float, offset: Float): GradientShader { if (enable) { strengthX = x strengthY = y - this.maxColors = maxColors + this.maxColors = gradient.size colors = gradient.toTypedArray() this.speed = speed this.offset = offset