Skip to content

Commit

Permalink
Scaffold rewrite (#462)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
rfresh2 and Avanatiker authored Jan 25, 2023
1 parent f974c66 commit 9b5e426
Show file tree
Hide file tree
Showing 6 changed files with 398 additions and 109 deletions.
109 changes: 109 additions & 0 deletions src/main/kotlin/com/lambda/client/command/commands/ScaffoldCommand.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
package com.lambda.client.command.commands

import com.lambda.client.command.ClientCommand
import com.lambda.client.module.modules.player.Scaffold
import com.lambda.client.util.items.shulkerList
import com.lambda.client.util.text.MessageSendHelper
import com.lambda.client.util.text.formatValue

object ScaffoldCommand : ClientCommand(
name = "scaffold",
description = "Manage scaffold whitelist/blacklist"
) {
init {
literal("whitelist", "wl") {
literal("add", "+") {
literal("shulker_box") {
execute("Add all shulker box types to whitelist") {
Scaffold.blockSelectionWhitelist.editValue { whitelist -> shulkerList.forEach { whitelist.add(it.localizedName) } }
MessageSendHelper.sendChatMessage("All shulker boxes have been added to whitelist")
}
}
block("block") { blockArg ->
execute("Add a block to Scaffold whitelist") {
val blockName = blockArg.value.registryName.toString()
if (Scaffold.blockSelectionWhitelist.contains(blockName)) {
MessageSendHelper.sendErrorMessage("${formatValue(blockName)} is already added to scaffold whitelist")
} else {
Scaffold.blockSelectionWhitelist.editValue { it.add(blockName) }
MessageSendHelper.sendChatMessage("${formatValue(blockName)} has been added to scaffold whitelist")
}
}
}
}
literal("del", "-") {
literal("shulker_box") {
execute("Remove all shulker box types from whitelist") {
Scaffold.blockSelectionWhitelist.editValue { whitelist -> shulkerList.forEach { whitelist.remove(it.localizedName) } }
MessageSendHelper.sendChatMessage("All shulker boxes have been removed from whitelist")
}
}
block("block") { blockArg ->
execute("Removes a block from the Scaffold whitelist") {
val blockName = blockArg.value.registryName.toString()
Scaffold.blockSelectionWhitelist.editValue { it.remove(blockName) }
MessageSendHelper.sendChatMessage("${formatValue(blockName)} has been removed from scaffold whitelist")
}
}
}
literal("clear", "c") {
execute {
Scaffold.blockSelectionWhitelist.editValue { it.clear() }
MessageSendHelper.sendChatMessage("Whitelist has been cleared")
}
}
literal("list") {
execute {
MessageSendHelper.sendChatMessage("Blocks: ${Scaffold.blockSelectionWhitelist.joinToString()}")
}
}
}
literal("blacklist", "bl") {
literal("add", "+") {
literal("shulker_box") {
execute("Add all shulker box types to blacklist") {
Scaffold.blockSelectionBlacklist.editValue { blacklist -> shulkerList.forEach { blacklist.add(it.localizedName) } }
MessageSendHelper.sendChatMessage("All shulker boxes have been added to blacklist")
}
}
block("block") { blockArg ->
execute("Add a block to Scaffold blacklist") {
val blockName = blockArg.value.registryName.toString()
if (Scaffold.blockSelectionBlacklist.contains(blockName)) {
MessageSendHelper.sendErrorMessage("${formatValue(blockName)} is already added to scaffold blacklist")
} else {
Scaffold.blockSelectionBlacklist.editValue { it.add(blockName) }
MessageSendHelper.sendChatMessage("${formatValue(blockName)} has been added to scaffold blacklist")
}
}
}
}
literal("del", "-") {
literal("shulker_box") {
execute("Remove all shulker box types from blacklist") {
Scaffold.blockSelectionBlacklist.editValue { blacklist -> shulkerList.forEach { blacklist.remove(it.localizedName) } }
MessageSendHelper.sendChatMessage("All shulker boxes have been removed from blacklist")
}
}
block("block") { blockArg ->
execute("Removes a block from the Scaffold blacklist") {
val blockName = blockArg.value.registryName.toString()
Scaffold.blockSelectionBlacklist.editValue { it.remove(blockName) }
MessageSendHelper.sendChatMessage("${formatValue(blockName)} has been removed from scaffold blacklist")
}
}
}
literal("clear", "c") {
execute {
Scaffold.blockSelectionBlacklist.editValue { it.clear() }
MessageSendHelper.sendChatMessage("Blacklist has been cleared")
}
}
literal("list") {
execute {
MessageSendHelper.sendChatMessage("Blocks: ${Scaffold.blockSelectionBlacklist.joinToString()}")
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ object NoFall : Module(
category = Category.PLAYER
) {
private val distance by setting("Distance", 3, 1..10, 1)
private val mode by setting("Mode", Mode.CATCH)
var mode by setting("Mode", Mode.CATCH)
private val fallModeSetting by setting("Fall", FallMode.PACKET, { mode == Mode.FALL })
private val catchModeSetting by setting("Catch", CatchMode.MOTION, { mode == Mode.CATCH })
private val voidOnly by setting("Void Only", false, { mode == Mode.CATCH })

private enum class Mode {
enum class Mode {
FALL, CATCH
}

Expand Down
Loading

0 comments on commit 9b5e426

Please sign in to comment.