Skip to content

Commit 9b5e426

Browse files
rfresh2Avanatiker
andauthored
Scaffold rewrite (#462)
* Sketch * Working sketch * Better default settings * Fix rubberbanding * Fix previous block state and default settings * Fix placement selection * Scaffold rewrite Makes tower mode actually work and adds ghost blocks for increased placing speed tested working on 2b2t * Scaffold: don't swap to block if we already have one equipped * Scaffold: Whitelist/Blacklist/Any block selection modes * Fix tower teleports by moving back onto top block * merge rfresh+constructor scaffolds * Small changes * only tower when player is not moving * refactor block selection * Little cleanup * tower check hotbarspoof compat * in water tower check * water tower scaffold and place on water surface * small style * swap in blocks from inventory when not in hotbar * assign all settings to a page * Added NoFall enabler and boundary checks for placements * Build down mode * Missed this * tower: burrow check * improve water tower reliability * reset movement speed to slightly slower than normal during down scaffold * mc bingbong * Cleanup * prevent sneak place opening blacklisted blocks * barrier = undefined, prefer not sneaking ig * oneliner * Other defaults and prevent action on flight * Check for correct item * Use shulkerList * Ops i mean blacklist * Fix blockBlacklist * Seems to need both * Use utils * Revert unneeded code Co-authored-by: Constructor <fractalminds@protonmail.com>
1 parent f974c66 commit 9b5e426

File tree

6 files changed

+398
-109
lines changed

6 files changed

+398
-109
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
package com.lambda.client.command.commands
2+
3+
import com.lambda.client.command.ClientCommand
4+
import com.lambda.client.module.modules.player.Scaffold
5+
import com.lambda.client.util.items.shulkerList
6+
import com.lambda.client.util.text.MessageSendHelper
7+
import com.lambda.client.util.text.formatValue
8+
9+
object ScaffoldCommand : ClientCommand(
10+
name = "scaffold",
11+
description = "Manage scaffold whitelist/blacklist"
12+
) {
13+
init {
14+
literal("whitelist", "wl") {
15+
literal("add", "+") {
16+
literal("shulker_box") {
17+
execute("Add all shulker box types to whitelist") {
18+
Scaffold.blockSelectionWhitelist.editValue { whitelist -> shulkerList.forEach { whitelist.add(it.localizedName) } }
19+
MessageSendHelper.sendChatMessage("All shulker boxes have been added to whitelist")
20+
}
21+
}
22+
block("block") { blockArg ->
23+
execute("Add a block to Scaffold whitelist") {
24+
val blockName = blockArg.value.registryName.toString()
25+
if (Scaffold.blockSelectionWhitelist.contains(blockName)) {
26+
MessageSendHelper.sendErrorMessage("${formatValue(blockName)} is already added to scaffold whitelist")
27+
} else {
28+
Scaffold.blockSelectionWhitelist.editValue { it.add(blockName) }
29+
MessageSendHelper.sendChatMessage("${formatValue(blockName)} has been added to scaffold whitelist")
30+
}
31+
}
32+
}
33+
}
34+
literal("del", "-") {
35+
literal("shulker_box") {
36+
execute("Remove all shulker box types from whitelist") {
37+
Scaffold.blockSelectionWhitelist.editValue { whitelist -> shulkerList.forEach { whitelist.remove(it.localizedName) } }
38+
MessageSendHelper.sendChatMessage("All shulker boxes have been removed from whitelist")
39+
}
40+
}
41+
block("block") { blockArg ->
42+
execute("Removes a block from the Scaffold whitelist") {
43+
val blockName = blockArg.value.registryName.toString()
44+
Scaffold.blockSelectionWhitelist.editValue { it.remove(blockName) }
45+
MessageSendHelper.sendChatMessage("${formatValue(blockName)} has been removed from scaffold whitelist")
46+
}
47+
}
48+
}
49+
literal("clear", "c") {
50+
execute {
51+
Scaffold.blockSelectionWhitelist.editValue { it.clear() }
52+
MessageSendHelper.sendChatMessage("Whitelist has been cleared")
53+
}
54+
}
55+
literal("list") {
56+
execute {
57+
MessageSendHelper.sendChatMessage("Blocks: ${Scaffold.blockSelectionWhitelist.joinToString()}")
58+
}
59+
}
60+
}
61+
literal("blacklist", "bl") {
62+
literal("add", "+") {
63+
literal("shulker_box") {
64+
execute("Add all shulker box types to blacklist") {
65+
Scaffold.blockSelectionBlacklist.editValue { blacklist -> shulkerList.forEach { blacklist.add(it.localizedName) } }
66+
MessageSendHelper.sendChatMessage("All shulker boxes have been added to blacklist")
67+
}
68+
}
69+
block("block") { blockArg ->
70+
execute("Add a block to Scaffold blacklist") {
71+
val blockName = blockArg.value.registryName.toString()
72+
if (Scaffold.blockSelectionBlacklist.contains(blockName)) {
73+
MessageSendHelper.sendErrorMessage("${formatValue(blockName)} is already added to scaffold blacklist")
74+
} else {
75+
Scaffold.blockSelectionBlacklist.editValue { it.add(blockName) }
76+
MessageSendHelper.sendChatMessage("${formatValue(blockName)} has been added to scaffold blacklist")
77+
}
78+
}
79+
}
80+
}
81+
literal("del", "-") {
82+
literal("shulker_box") {
83+
execute("Remove all shulker box types from blacklist") {
84+
Scaffold.blockSelectionBlacklist.editValue { blacklist -> shulkerList.forEach { blacklist.remove(it.localizedName) } }
85+
MessageSendHelper.sendChatMessage("All shulker boxes have been removed from blacklist")
86+
}
87+
}
88+
block("block") { blockArg ->
89+
execute("Removes a block from the Scaffold blacklist") {
90+
val blockName = blockArg.value.registryName.toString()
91+
Scaffold.blockSelectionBlacklist.editValue { it.remove(blockName) }
92+
MessageSendHelper.sendChatMessage("${formatValue(blockName)} has been removed from scaffold blacklist")
93+
}
94+
}
95+
}
96+
literal("clear", "c") {
97+
execute {
98+
Scaffold.blockSelectionBlacklist.editValue { it.clear() }
99+
MessageSendHelper.sendChatMessage("Blacklist has been cleared")
100+
}
101+
}
102+
literal("list") {
103+
execute {
104+
MessageSendHelper.sendChatMessage("Blocks: ${Scaffold.blockSelectionBlacklist.joinToString()}")
105+
}
106+
}
107+
}
108+
}
109+
}

src/main/kotlin/com/lambda/client/module/modules/player/NoFall.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ object NoFall : Module(
2727
category = Category.PLAYER
2828
) {
2929
private val distance by setting("Distance", 3, 1..10, 1)
30-
private val mode by setting("Mode", Mode.CATCH)
30+
var mode by setting("Mode", Mode.CATCH)
3131
private val fallModeSetting by setting("Fall", FallMode.PACKET, { mode == Mode.FALL })
3232
private val catchModeSetting by setting("Catch", CatchMode.MOTION, { mode == Mode.CATCH })
3333
private val voidOnly by setting("Void Only", false, { mode == Mode.CATCH })
3434

35-
private enum class Mode {
35+
enum class Mode {
3636
FALL, CATCH
3737
}
3838

0 commit comments

Comments
 (0)