Skip to content

Commit a1e6c5a

Browse files
committed
Custom baritone build test
1 parent b515d94 commit a1e6c5a

File tree

5 files changed

+37
-34
lines changed

5 files changed

+37
-34
lines changed

build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ dependencies {
108108
compileOnly 'org.jetbrains:annotations:23.0.0'
109109

110110
// This Baritone will NOT be included in the jar
111-
implementation 'com.github.cabaletta:baritone:1.2.14'
112-
113-
// This Baritone WILL be included in the jar
114-
jarLibs 'cabaletta:baritone-api:1.2'
111+
jarLibs files("libs/baritone-api-forge-1.2.15.jar")
115112

116113
// Add everything in jarLibs to implementation (compile)
117114
implementation configurations.jarLibs

libs/baritone-api-forge-1.2.15.jar

1.36 MB
Binary file not shown.

src/main/kotlin/com/lambda/client/manager/managers/PlayerInventoryManager.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ object PlayerInventoryManager : Manager {
167167
currentId = 0
168168
}
169169

170+
fun isDone() = transactionQueue.isEmpty()
171+
170172
/**
171173
* Adds a new task to the inventory manager
172174
*

src/main/kotlin/com/lambda/client/module/modules/movement/InventoryMove.kt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
package com.lambda.client.module.modules.movement
22

33
import com.lambda.client.LambdaMod
4+
import com.lambda.client.event.events.PacketEvent
45
import com.lambda.client.gui.AbstractLambdaGui
56
import com.lambda.client.module.Category
67
import com.lambda.client.module.Module
8+
import com.lambda.client.util.MovementUtils.isMoving
79
import com.lambda.client.util.threads.safeListener
810
import net.minecraft.client.gui.GuiChat
911
import net.minecraft.client.gui.GuiRepair
1012
import net.minecraft.client.gui.GuiScreen
1113
import net.minecraft.client.gui.inventory.GuiEditSign
14+
import net.minecraft.network.play.client.CPacketClickWindow
15+
import net.minecraft.network.play.client.CPacketEntityAction
16+
import net.minecraft.network.play.client.CPacketPlayer
1217
import net.minecraft.util.MovementInputFromOptions
1318
import net.minecraftforge.client.event.InputUpdateEvent
1419
import org.lwjgl.input.Keyboard
@@ -19,11 +24,40 @@ object InventoryMove : Module(
1924
category = Category.MOVEMENT
2025
) {
2126
private val rotateSpeed by setting("Rotate Speed", 5, 0..20, 1)
27+
private val itemMovement by setting("Item Movement", true)
2228
val sneak by setting("Sneak", false)
2329

2430
private var hasSent = false
2531

32+
private var savedClickWindow = CPacketClickWindow()
33+
private const val upSpoofDistance = 0.0656
34+
2635
init {
36+
safeListener<PacketEvent.Send> {
37+
if (itemMovement
38+
&& player.onGround
39+
&& it.packet is CPacketClickWindow
40+
&& it.packet != savedClickWindow
41+
&& player.isMoving
42+
&& world.getCollisionBoxes(player, player.entityBoundingBox.offset(0.0, upSpoofDistance, 0.0)).isEmpty()
43+
) {
44+
savedClickWindow = it.packet
45+
46+
it.cancel()
47+
48+
if (player.isSprinting) {
49+
player.connection.sendPacket(CPacketEntityAction(player, CPacketEntityAction.Action.STOP_SPRINTING))
50+
}
51+
52+
player.connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + upSpoofDistance, player.posZ, false))
53+
player.connection.sendPacket(it.packet)
54+
55+
if (player.isSprinting) {
56+
player.connection.sendPacket(CPacketEntityAction(player, CPacketEntityAction.Action.START_SPRINTING))
57+
}
58+
}
59+
}
60+
2761
safeListener<InputUpdateEvent>(9999) {
2862
if (it.movementInput !is MovementInputFromOptions || isInvalidGui(mc.currentScreen)) return@safeListener
2963

src/main/kotlin/com/lambda/client/module/modules/movement/NoSlowDown.kt

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ object NoSlowDown : Module(
3131
) {
3232
private val ncpStrict by setting("NCP Strict", true)
3333
private val sneak by setting("Sneak", false)
34-
private val itemMovement by setting("Item Movement", false)
3534
val soulSand by setting("Soul Sand", true)
3635
val cobweb by setting("Cobweb", true)
3736
private val slime by setting("Slime", true)
@@ -41,10 +40,6 @@ object NoSlowDown : Module(
4140
private val potion by setting("Potions", true, { !allItems })
4241
private val shield by setting("Shield", true, { !allItems })
4342

44-
private var savedClickWindow = CPacketClickWindow()
45-
46-
private const val upSpoofDistance = 0.0656
47-
4843
/*
4944
* InputUpdateEvent is called just before the player is slowed down @see EntityPlayerSP.onLivingUpdate)
5045
* We'll abuse this fact, and multiply moveStrafe and moveForward by 5 to nullify the *0.2f hardcoded by Mojang.
@@ -59,31 +54,6 @@ object NoSlowDown : Module(
5954
}
6055
}
6156

62-
safeListener<PacketEvent.Send> {
63-
if (itemMovement
64-
&& player.onGround
65-
&& it.packet is CPacketClickWindow
66-
&& it.packet != savedClickWindow
67-
&& player.isMoving
68-
&& world.getCollisionBoxes(player, player.entityBoundingBox.offset(0.0, upSpoofDistance, 0.0)).isEmpty()
69-
) {
70-
savedClickWindow = it.packet
71-
72-
it.cancel()
73-
74-
if (player.isSprinting) {
75-
player.connection.sendPacket(CPacketEntityAction(player, CPacketEntityAction.Action.STOP_SPRINTING))
76-
}
77-
78-
player.connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + upSpoofDistance, player.posZ, false))
79-
player.connection.sendPacket(it.packet)
80-
81-
if (player.isSprinting) {
82-
player.connection.sendPacket(CPacketEntityAction(player, CPacketEntityAction.Action.START_SPRINTING))
83-
}
84-
}
85-
}
86-
8757
/**
8858
* @author ionar2
8959
* Used with explicit permission and MIT license permission

0 commit comments

Comments
 (0)