Skip to content

Commit

Permalink
Merge branch 'CCBlueX:nextgen' into better-telly-thing-flagfold
Browse files Browse the repository at this point in the history
  • Loading branch information
larryngton2 authored Dec 1, 2024
2 parents 19d455d + 2281316 commit a2c1038
Show file tree
Hide file tree
Showing 51 changed files with 1,268 additions and 1,049 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
cd zip
zip -r liquidbounce.zip *
md5sum liquidbounce.zip
curl --connect-timeout 30 -m 300 -X POST -F "[email protected]" -H "Authorization: ${{ secrets.NIGHTLY_PASS }}" -F "gh_id=${{ github.event.head_commit.id }}" -F "gh_ref=${{ github.ref }}" -F "gh_message=${{ github.event.head_commit.message }}" -F "gh_timestamp=${{ github.event.head_commit.timestamp }}" -F "lb_version=$LB_VERSION" -F "mc_version=$MINECRAFT_VERSION" -F "subsystem=fabric" -F "jre_version=21" -F "jre_distribution=graalvm" -F "fabric_loader_version=$LOADER_VERSION" -F "fabric_api_version=$FABRICAPI_VERSION" -F "kotlin_version=$KOTLIN_VERSION" -F "fabric_kotlin_version=$FABRIC_KOTLIN_VERSION" https://api.liquidbounce.net/api/v1/version/new
curl --connect-timeout 30 -m 300 -X POST -F "[email protected]" -H "Authorization: ${{ secrets.NIGHTLY_PASS }}" -F "gh_id=${{ github.event.head_commit.id }}" -F "gh_ref=${{ github.ref }}" -F "gh_message=${{ github.event.head_commit.message }}" -F "gh_timestamp=${{ github.event.head_commit.timestamp }}" -F "lb_version=$LB_VERSION" -F "mc_version=$MINECRAFT_VERSION" -F "subsystem=fabric" -F "jre_version=21" -F "fabric_loader_version=$LOADER_VERSION" -F "fabric_api_version=$FABRICAPI_VERSION" -F "kotlin_version=$KOTLIN_VERSION" -F "fabric_kotlin_version=$FABRIC_KOTLIN_VERSION" https://api.liquidbounce.net/api/v1/version/new
verify-pr:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions config/detekt/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,11 @@
<ID>BracesOnIfStatements:ModuleTimerRange.kt$ModuleTimerRange$if</ID>
<ID>BracesOnIfStatements:RenderShortcuts.kt$else</ID>
<ID>BracesOnIfStatements:RenderShortcuts.kt$if</ID>
<ID>BracesOnIfStatements:SpeedGeneric.kt$SpeedBHopBase$if</ID>
<ID>BracesOnIfStatements:SpeedGrimCollide.kt$SpeedGrimCollide$if</ID>
<ID>BracesOnIfStatements:SpeedHypixelBHop.kt$SpeedHypixelBHop$if</ID>
<ID>BracesOnIfStatements:SpeedPreventDeadlyJump.kt$SpeedPreventDeadlyJump$if</ID>
<ID>BracesOnIfStatements:TargetFinding.kt$BlockPlacementTarget$if</ID>
<ID>BracesOnIfStatements:TargetRenderer.kt$WorldTargetRenderer.GlowingCircle$else</ID>
<ID>BracesOnIfStatements:TargetRenderer.kt$WorldTargetRenderer.GlowingCircle$if</ID>
<ID>CognitiveComplexMethod:AStarMode.kt$AStarMode$override fun enable()</ID>
<ID>CognitiveComplexMethod:AStarMode.kt$AStarMode$private fun findPath(start: Vec3i, end: Vec3i, maxCost: Int, maxIterations: Int = 500): List&lt;Vec3i></ID>
<ID>CognitiveComplexMethod:AutoConfig.kt$AutoConfig$fun handlePossibleAutoConfig(jsonObject: JsonObject)</ID>
<ID>CognitiveComplexMethod:BlockExtensions.kt$fun Block?.isInteractable(blockState: BlockState?): Boolean</ID>
Expand Down Expand Up @@ -124,7 +121,6 @@
<ID>PrintStackTrace:CommandManager.kt$CommandManager$e</ID>
<ID>ReturnCount:IntegrationListener.kt$IntegrationListener$private fun handleScreenSituation(screen: Screen?): Boolean</ID>
<ID>ReturnCount:SpeedAntiCornerBump.kt$SpeedAntiCornerBump$fun getSuggestedJumpDelay( simulatedPlayer: SimulatedPlayer, n: Int = 2, ): Int?</ID>
<ID>SpreadOperator:AStarMode.kt$AStarMode$( Vec3i(-1, 0, 0), // left Vec3i(1, 0, 0), // right *(-9..9).map { Vec3i(0, it, 0) }.toTypedArray(), // up- and down Vec3i(0, 0, -1), // front Vec3i(0, 0, 1) // back )</ID>
<ID>SpreadOperator:ModuleVomit.kt$ModuleVomit$( *emptySlots.map { slot -> CreativeInventoryAction.performFillSlot(randomStack, slot) } .toTypedArray(), *emptySlots.map { slot -> ClickInventoryAction.performThrow(null, slot) } .toTypedArray() )</ID>
<ID>StringLiteralDuplication:AutoQueueGommeDuels.kt$AutoQueueGommeDuels$"AutoPlay"</ID>
<ID>StringLiteralDuplication:ScriptSetting.kt$ScriptSetting$"default"</ID>
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fabric_version=0.107.0+1.21.1
# Loom
loom_version=1.8-SNAPSHOT
# Mod Properties
mod_version=0.20.1
mod_version=0.21.1
maven_group=net.ccbluex
archives_base_name=liquidbounce
# Kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,43 @@
*/
package net.ccbluex.liquidbounce.injection.mixins.minecraft.block;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import net.ccbluex.liquidbounce.common.ShapeFlag;
import net.ccbluex.liquidbounce.event.EventManager;
import net.ccbluex.liquidbounce.event.events.BlockShapeEvent;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.minecraft.world.BlockCollisionSpliterator;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(AbstractBlock.class)
public class MixinAbstractBlock {
@Mixin(BlockCollisionSpliterator.class)
public class MixinBlockCollisionSpliterator {

@Shadow
@Final
private BlockPos.Mutable pos;

/**
* Hook collision shape event
*
* @param original voxel shape
* @param state block state
* @param world block world
* @param pos block position
* @param context shape context
* @return possibly modified voxel shape
*/
@ModifyReturnValue(method = "getCollisionShape", at = @At("RETURN"))
private VoxelShape hookCollisionShape(VoxelShape original, BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
if (pos == null || ShapeFlag.noShapeChange) {
@ModifyExpressionValue(method = "computeNext", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/block/BlockState;getCollisionShape(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;"
))
private VoxelShape hookCollisionShape(VoxelShape original, @Local BlockState blockState) {
if (this.pos == null || ShapeFlag.noShapeChange) {
return original;
}

final BlockShapeEvent shapeEvent = EventManager.INSTANCE.callEvent(new BlockShapeEvent(state, pos, original));
final BlockShapeEvent shapeEvent = EventManager.INSTANCE.callEvent(new BlockShapeEvent(blockState, this.pos, original));
return shapeEvent.getShape();
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ import net.ccbluex.liquidbounce.features.command.Command
import net.ccbluex.liquidbounce.features.command.CommandException
import net.ccbluex.liquidbounce.features.command.CommandFactory
import net.ccbluex.liquidbounce.features.command.builder.CommandBuilder
import net.ccbluex.liquidbounce.features.command.builder.ParameterBuilder
import net.ccbluex.liquidbounce.features.command.builder.playerParameter
import net.ccbluex.liquidbounce.features.module.modules.misc.ModuleInventoryTracker
import net.ccbluex.liquidbounce.utils.client.mc
import net.ccbluex.liquidbounce.utils.client.network
import net.ccbluex.liquidbounce.utils.client.world
import net.minecraft.client.gui.DrawContext
import net.minecraft.client.gui.screen.ingame.InventoryScreen
import net.minecraft.client.network.AbstractClientPlayerEntity
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.screen.slot.Slot
import net.minecraft.screen.slot.SlotActionType
import net.ccbluex.liquidbounce.utils.inventory.ViewedInventoryScreen
import java.util.*

/**
* Command Invsee
Expand All @@ -43,47 +40,32 @@ import net.minecraft.screen.slot.SlotActionType
*/
object CommandInvsee : CommandFactory {

var viewedPlayer: AbstractClientPlayerEntity? = null
var viewedPlayer: UUID? = null

override fun createCommand(): Command {
return CommandBuilder
.begin("invsee")
.requiresIngame()
.parameter(
ParameterBuilder
.begin<String>("name")
.verifiedBy(ParameterBuilder.STRING_VALIDATOR)
.useMinecraftAutoCompletion()
playerParameter()
.required()
.build()
)
.handler { command, args ->
val inputName = (args[0] as String)
val player = world.players.find { it.nameForScoreboard.equals(inputName, true) }
?: throw CommandException(command.result("playerNotFound", inputName))
val inputName = args[0] as String
val playerID = network.playerList.find { it.profile.name.equals(inputName, true) }?.profile?.id
val player = { world.getPlayerByUuid(playerID) ?: ModuleInventoryTracker.playerMap[playerID] }

if (playerID == null || player() == null) {
throw CommandException(command.result("playerNotFound", inputName))
}

RenderSystem.recordRenderCall {
mc.setScreen(NoInteractInventory(player))
mc.setScreen(ViewedInventoryScreen(player))
}

viewedPlayer = player
viewedPlayer = playerID
}
.build()
}

}

class NoInteractInventory(private var player: PlayerEntity) : InventoryScreen(player) {

override fun drawBackground(context: DrawContext, delta: Float, mouseX: Int, mouseY: Int) {
context.drawTexture(BACKGROUND_TEXTURE, x, y, 0, 0, backgroundWidth, backgroundHeight)
drawEntity(
context, x + 26, y + 8, x + 75, y + 78,
30, 0.0625f, mouseX.toFloat(), mouseY.toFloat(),
player
)
}

@Suppress("detekt:EmptyFunctionBlock")
override fun onMouseClick(slot: Slot?, slotId: Int, button: Int, actionType: SlotActionType?) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ object ModuleManager : EventListener, Iterable<ClientModule> by modules {
ModuleBedDefender,
ModuleSurround,
ModulePacketMine,
ModuleHoleFiller,

// Client
ModuleAutoConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ object ModuleTimerRange : ClientModule("TimerRange", Category.COMBAT) {
private val timerBalanceLimit by float("TimerBalanceLimit", 20f, 0f..50f)
private val normalSpeed by float("NormalSpeed", 0.9F, 0.1F..10F)
private val inRangeSpeed by float("InRangeSpeed", 0.95F, 0.1F..10F)
private val balanceLimitSpeed by float("BalanceLimitSpeed", 0.99F, 0.1F..1F)
private val boostSpeed by float("BoostTimer", 2F, 0.1F..10F).apply { tagBy(this) }
private val balanceRecoveryIncrement by float("BalanceRecoveryIncrement", 1f, 1f..10f)
private val distanceToSpeedUp by float("DistanceToSpeedUp", 3.5f, 0f..10f)
private val distanceToPause by float("DistanceToPause", 3f, 0f..10f)
private val distanceToStartWorking by float("DistanceToStartWorking", 100f, 0f..500f)
private val pauseOnFlag by boolean("PauseOnFlag", true)
private val onlyOnGround by boolean("OnlyOnGround", false)

private var reachedTheLimit = false
private var balanceTimer = 0f
Expand All @@ -56,6 +58,10 @@ object ModuleTimerRange : ClientModule("TimerRange", Category.COMBAT) {
}

val repeatable = tickHandler {
if (onlyOnGround && !player.isOnGround) {
return@tickHandler
}

val newTimerSpeed = updateTimerSpeed()

if (newTimerSpeed != null) {
Expand All @@ -66,6 +72,10 @@ object ModuleTimerRange : ClientModule("TimerRange", Category.COMBAT) {
if ((balanceTimer > 0 || balanceChange > 0) && (balanceTimer < timerBalanceLimit * 2 || balanceChange < 0))
balanceTimer += balanceChange

if (balanceTimer <= timerBalanceLimit) {
Timer.requestTimerSpeed(balanceLimitSpeed, Priority.IMPORTANT_FOR_USAGE_1, this@ModuleTimerRange)
}

if (balanceTimer <= 0) {
reachedTheLimit = false
}
Expand Down
Loading

0 comments on commit a2c1038

Please sign in to comment.