Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Checkout pisun
uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -33,4 +33,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: FDPClient
path: build/libs/FDPClient-build.jar
path: build/libs/FDPClient-build.jar
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package net.ccbluex.liquidbounce.features.module.modules.movement
import net.ccbluex.liquidbounce.event.JumpEvent
import net.ccbluex.liquidbounce.event.MoveEvent
import net.ccbluex.liquidbounce.event.UpdateEvent
import net.ccbluex.liquidbounce.event.PacketEvent
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.features.module.Module
Expand All @@ -22,84 +23,215 @@ import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.o
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.other.VerusDamage.damaged
import net.ccbluex.liquidbounce.utils.extensions.isMoving
import net.ccbluex.liquidbounce.utils.extensions.tryJump
import net.minecraft.block.BlockSlab
import net.minecraft.block.BlockStairs
import net.minecraft.network.play.server.S08PacketPlayerPosLook
import net.minecraft.util.BlockPos
import net.minecraft.util.ChatComponentText
import kotlin.math.cos
import kotlin.math.sin

object LongJump : Module("LongJump", Category.MOVEMENT, Category.SubCategory.MOVEMENT_MAIN) {

private val longJumpModes = arrayOf(
// NCP
NCP,

// AAC
AACv1, AACv2, AACv3,

// Other
Redesky, Hycraft, Buzz, VerusDamage
NCP, AACv1, AACv2, AACv3, Redesky, Hycraft, Buzz, VerusDamage
)

private val modes = longJumpModes.map { it.modeName }.toTypedArray()
private val modes = longJumpModes.map { it.modeName }.toMutableList().apply {
add("Matrix")
add("Slap")
}.toTypedArray()

val mode by choices("Mode", modes, "NCP")
val ncpBoost by float("NCPBoost", 4.25f, 1f..10f) { mode == "NCP" }
val matrixSpeed by float("MatrixSpeed", 2.0f, 0.1f..5.0f) { mode == "Matrix" }
val matrixTicks by int("MatrixTicks", 20, 1..100) { mode == "Matrix" }

private val autoJump by boolean("AutoJump", true)
val autoDisable by boolean("AutoDisable", true) { mode == "VerusDamage" || mode == "Matrix" }

val autoDisable by boolean("AutoDisable", true) { mode == "VerusDamage" }

@JvmField
var jumped = false
@JvmField
var canBoost = false
var teleported = false
@JvmField
var teleported = false // Чтобы AACv3 не ругался

private var placed = false
private var flag = false
private var sent = false
private var ticks = 0
private var firstDir = 0.0f

// Прямой расчет скорости без MoveUtils
private fun strafe(speed: Double) {
var yaw = mc.thePlayer.rotationYaw.toDouble()
val forward = mc.thePlayer.movementInput.moveForward.toDouble()
val strafe = mc.thePlayer.movementInput.moveStrafe.toDouble()
if (forward == 0.0 && strafe == 0.0) {
mc.thePlayer.motionX = 0.0
mc.thePlayer.motionZ = 0.0
} else {
if (forward != 0.0) {
if (strafe > 0.0) {
yaw += (if (forward > 0.0) -45 else 45).toDouble()
} else if (strafe < 0.0) {
yaw += (if (forward > 0.0) 45 else -45).toDouble()
}
}
val rad = Math.toRadians(yaw)
mc.thePlayer.motionX = -sin(rad) * speed
mc.thePlayer.motionZ = cos(rad) * speed
}
}

val onUpdate = handler<UpdateEvent> {
if (jumped) {
val mode = mode
val currentMode = mode

if (currentMode == "Slap") {
if (!mc.thePlayer.isInWater) {
var slot = -1
for (i in 0..8) {
val stack = mc.thePlayer.inventory.getStackInSlot(i)
if (stack != null && stack.item is net.minecraft.item.ItemBlock) {
slot = i
break
}
}

if (slot == -1) {
mc.thePlayer.addChatMessage(ChatComponentText("§c[LongJump] §fNo blocks!"))
state = false
return@handler
}

val oldSlot = mc.thePlayer.inventory.currentItem
val trace = mc.thePlayer.rayTrace(2.0, 1.0f)

if (trace != null && trace.typeOfHit == net.minecraft.util.MovingObjectPosition.MovingObjectType.BLOCK) {
val pos = trace.blockPos
if (mc.thePlayer.isMoving) {
if (mc.thePlayer.fallDistance >= 0.8f &&
mc.theWorld.isAirBlock(BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ)) &&
!mc.theWorld.isAirBlock(pos) &&
mc.theWorld.getBlockState(pos).block !is BlockSlab &&
mc.theWorld.getBlockState(pos).block !is BlockStairs) {

mc.thePlayer.inventory.currentItem = slot
placed = true
if (mc.playerController.onPlayerRightClick(mc.thePlayer, mc.theWorld, mc.thePlayer.heldItem, pos, trace.sideHit, trace.hitVec)) {
mc.thePlayer.swingItem()
}
mc.thePlayer.inventory.currentItem = oldSlot
mc.thePlayer.fallDistance = 0f
}
mc.gameSettings.keyBindJump.pressed = false
if (mc.thePlayer.onGround && placed) {
placed = false
} else if (mc.thePlayer.onGround) {
mc.thePlayer.jump()
}
}
}
}
} else if (currentMode == "Matrix") {
if (!canBoost) {
mc.thePlayer.motionX = 0.0
mc.thePlayer.motionZ = 0.0
}

if (!sent) {
mc.thePlayer.motionX = 0.0
mc.thePlayer.motionZ = 0.0
if (ticks > matrixTicks) {
sent = true
ticks = 0
canBoost = true
mc.timer.timerSpeed = 1.0f
}
}

if (canBoost) {
strafe(matrixSpeed.toDouble())
mc.thePlayer.motionY = 0.42
if (flag) state = false
}
ticks++
}

if (jumped) {
if (mc.thePlayer.onGround || mc.thePlayer.capabilities.isFlying) {
jumped = false

if (mode == "NCP") {
if (currentMode == "NCP") {
mc.thePlayer.motionX = 0.0
mc.thePlayer.motionZ = 0.0
}
return@handler
}

modeModule.onUpdate()
}
if (autoJump && mc.thePlayer.onGround && mc.thePlayer.isMoving) {
if (autoDisable && !damaged) {
return@handler
if (currentMode !in listOf("Matrix", "Slap")) {
modeModule.onUpdate()
}
}

if (autoJump && mc.thePlayer.onGround && mc.thePlayer.isMoving) {
if (autoDisable && currentMode == "VerusDamage" && !damaged) return@handler
jumped = true
mc.thePlayer.tryJump()
}
}

val onMove = handler<MoveEvent> { event ->
modeModule.onMove(event)
if (mode == "Matrix" && !canBoost) {
event.x = 0.0
event.z = 0.0
}
if (mode !in listOf("Matrix", "Slap")) {
modeModule.onMove(event)
}
}

val onPacket = handler<PacketEvent> { event ->
val packet = event.packet
if (packet is S08PacketPlayerPosLook) {
if (mode == "Slap") placed = false
if (mode == "Matrix") flag = true
}
}

override fun onEnable() {
modeModule.onEnable()
placed = false
jumped = false
canBoost = false
teleported = false
if (mode == "Matrix") {
flag = false
sent = false
ticks = 0
firstDir = mc.thePlayer.rotationYaw
}
if (mode !in listOf("Matrix", "Slap")) {
modeModule.onEnable()
}
}

override fun onDisable() {
modeModule.onDisable()
mc.timer.timerSpeed = 1.0f
if (mode !in listOf("Matrix", "Slap")) {
modeModule.onDisable()
}
}

val onJump = handler<JumpEvent>(always = true) { event ->
jumped = true
canBoost = true
teleported = false

if (handleEvents()) {
if (handleEvents() && mode !in listOf("Matrix", "Slap")) {
modeModule.onJump(event)
}
}

override val tag
get() = mode
override val tag get() = mode

private val modeModule
get() = longJumpModes.find { it.modeName == mode }!!
private val modeModule get() = longJumpModes.find { it.modeName == mode }!!
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

import static net.ccbluex.liquidbounce.utils.client.MinecraftInstance.mc;

@Mixin(Minecraft.class)
@SideOnly(Side.CLIENT)
public abstract class MixinMinecraft {
Expand Down Expand Up @@ -157,13 +155,19 @@ private void createDisplay(CallbackInfo callbackInfo) {
}
}

/**
* AI_Kolbasa Fix: Решаем NoSuchMethodError: ScaledResolution.<init>
* Используем прямой каст (Minecraft) (Object) this вместо статического mc.
*/
@Inject(method = "displayGuiScreen", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;currentScreen:Lnet/minecraft/client/gui/GuiScreen;", shift = At.Shift.AFTER))
private void handleDisplayGuiScreen(CallbackInfo callbackInfo) {
if (currentScreen instanceof net.minecraft.client.gui.GuiMainMenu || (currentScreen != null && currentScreen.getClass().getName().startsWith("net.labymod") && currentScreen.getClass().getSimpleName().equals("ModGuiMainMenu"))) {
currentScreen = new GuiMainMenu();

ScaledResolution scaledResolution = new ScaledResolution(mc);
currentScreen.setWorldAndResolution(mc, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight());
Minecraft minecraftInstance = (Minecraft) (Object) this;
ScaledResolution scaledResolution = new ScaledResolution(minecraftInstance);

currentScreen.setWorldAndResolution(minecraftInstance, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight());
skipRenderWorld = false;
}

Expand Down Expand Up @@ -208,12 +212,10 @@ private void onKey(CallbackInfo callbackInfo) {
int keyCode = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey();
boolean pressed = Keyboard.getEventKeyState();

// Fire KeyStateEvent on both press and release
if (currentScreen == null) {
EventManager.INSTANCE.call(new KeyStateEvent(keyCode, pressed));
}

// Fire KeyEvent only on press
if (pressed && currentScreen == null) {
EventManager.INSTANCE.call(new KeyEvent(keyCode));
}
Expand Down Expand Up @@ -276,17 +278,13 @@ private void rightClickMouse(final CallbackInfo callbackInfo) {
final FastPlace fastPlace = FastPlace.INSTANCE;
if (!fastPlace.handleEvents()) return;

// Don't spam-click when the player isn't holding blocks
if (fastPlace.getOnlyBlocks() && (thePlayer.getHeldItem() == null || !(thePlayer.getHeldItem().getItem() instanceof ItemBlock)))
return;

if (objectMouseOver != null && objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
BlockPos blockPos = objectMouseOver.getBlockPos();
IBlockState blockState = theWorld.getBlockState(blockPos);
// Don't spam-click when interacting with a TileEntity (chests, ...)
// Doesn't prevent spam-clicking anvils, crafting tables, ... (couldn't figure out a non-hacky way)
if (blockState.getBlock().hasTileEntity(blockState)) return;
// Return if not facing a block
} else if (fastPlace.getFacingBlocks()) return;

rightClickDelayTimer = fastPlace.getSpeed();
Expand All @@ -301,13 +299,10 @@ private void loadWorld(WorldClient p_loadWorld_1_, String p_loadWorld_2_, final
EventManager.INSTANCE.call(new WorldEvent(p_loadWorld_1_));
}


@Redirect(method = "sendClickBlockToController", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;isUsingItem()Z"))
private boolean injectMultiActions(EntityPlayerSP instance) {
ItemStack itemStack = instance.itemInUse;

if (MultiActions.INSTANCE.handleEvents()) itemStack = null;

return itemStack != null;
}

Expand Down
11 changes: 5 additions & 6 deletions src/main/java/net/ccbluex/liquidbounce/utils/io/HttpUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package net.ccbluex.liquidbounce.utils.io

import io.netty.channel.EventLoopGroup
import io.netty.channel.epoll.Epoll
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
Expand Down Expand Up @@ -41,11 +40,11 @@ import javax.net.ssl.X509TrustManager
val DEFAULT_AGENT =
"${CLIENT_NAME}/${clientVersionText} (${clientCommit}, ${if (IN_DEV) "dev" else "release"}, ${System.getProperty("os.name")})"

val clientEventLoopGroup: EventLoopGroup get() = if (Epoll.isAvailable()) {
NetworkManager.CLIENT_EPOLL_EVENTLOOP.value
} else {
NetworkManager.CLIENT_NIO_EVENTLOOP.value
}
/**
* AI_Kolbasa Fix: Убираем Epoll.isAvailable(), чтобы Windows не вылетала с NoClassDefFoundError.
* На винде Epoll не существует, а попытка его проверить на Java 8 руинит запуск.
*/
val clientEventLoopGroup: EventLoopGroup get() = NetworkManager.CLIENT_NIO_EVENTLOOP.value

/**
* Global [OkHttpClient]
Expand Down
Loading