Skip to content

Commit a3439cd

Browse files
committed
internalised all breaking variables rather than using the interaction manager
1 parent 0797e8a commit a3439cd

File tree

5 files changed

+173
-123
lines changed

5 files changed

+173
-123
lines changed

common/src/main/kotlin/com/lambda/config/groups/BuildConfig.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ interface BuildConfig {
2626
val collectDrops: Boolean
2727

2828
// Breaking
29+
val breakThreshold: Float
2930
val rotateForBreak: Boolean
3031
val breakConfirmation: Boolean
3132
val maxPendingBreaks: Int

common/src/main/kotlin/com/lambda/config/groups/BuildSettings.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class BuildSettings(
3737
override val collectDrops by c.setting("Collect All Drops", false, "Collect all drops when breaking blocks") { vis() && page == Page.GENERAL }
3838

3939
// Breaking
40+
override val breakThreshold by c.setting("Break Threshold", 1.0f, 0.1f..1.0f, 0.1f, "The amount broken, between 0.0 and 1.0, a block should be considered broken") { vis() && page == Page.BREAK }
4041
override val rotateForBreak by c.setting("Rotate For Break", true, "Rotate towards block while breaking") { vis() && page == Page.BREAK }
4142
override val breakConfirmation by c.setting("Break Confirmation", false, "Wait for block break confirmation") { vis() && page == Page.BREAK }
4243
override val maxPendingBreaks by c.setting("Max Pending Breaks", 1, 1..10, 1, "Maximum pending block breaks") { vis() && page == Page.BREAK }

common/src/main/kotlin/com/lambda/module/modules/player/PacketMineTaskRewrite.kt

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,23 @@ object PacketMineTaskRewrite : Module(
4747
) {
4848
private val page by setting("Page", Page.General)
4949

50+
private val breakThreshold by setting(
51+
"Break Threshold",
52+
1.0f,
53+
0.1f..1.0f,
54+
0.1f,
55+
"The amount broken, between 0.0 and 1.0, a block should be considered broken"
56+
) { page == Page.General }
57+
private val breakConfirmation by setting(
58+
"Break Confirmation",
59+
false,
60+
"Waits for the server to confirm the break"
61+
) { page == Page.General }
5062
private val doubleBreak by setting(
5163
"Double Break",
5264
false,
5365
"Lets the player break two blocks at once"
5466
) { page == Page.General }
55-
private val validateBreak by setting(
56-
"Validate Break",
57-
false,
58-
"Awaits the servers response before confirming the block to be broken"
59-
) { page == Page.General }
6067
private val useInventory by setting(
6168
"Use Inventory",
6269
false,
@@ -65,11 +72,16 @@ object PacketMineTaskRewrite : Module(
6572
private val interactionDelay by setting(
6673
"Interact Delay",
6774
0,
68-
0..10,
75+
0..5,
6976
1,
7077
"The delay between interacting with blocks",
7178
"ticks"
7279
) { page == Page.General }
80+
private val swingHand by setting(
81+
"Swing Hand",
82+
PacketBreakBlock.SwingHandStyle.Start,
83+
"Defines the points at which the players hand should swing throughout the break"
84+
) { page == Page.General }
7385

7486
private val reBreak by setting(
7587
"Re-Break",
@@ -171,15 +183,11 @@ object PacketMineTaskRewrite : Module(
171183
instantBreak
172184
)
173185
packetBreakTask = PacketBreakBlock(
174-
breakContext,
175-
bestTool,
176-
false,
177-
PacketBreakBlock.SwingHandStyle.Start,
178-
breakingTexture = true,
179-
breakingSound = true,
180-
breakingParticles = true,
181-
collectDrop = false,
182-
rotation = null
186+
ctx = breakContext,
187+
tool = bestTool,
188+
breakThreshold = breakThreshold,
189+
internalBreakConfirmation = breakConfirmation,
190+
swingHand = swingHand
183191
).finally {
184192
breakTasks[breakType.index] = null
185193
} as PacketBreakBlock

0 commit comments

Comments
 (0)