Skip to content

Commit 3253c5c

Browse files
committed
fix conflicts
2 parents 8c3324d + 99d1c14 commit 3253c5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+935
-974
lines changed

build.gradle.kts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ val mockitoKotlin : String by project
3939
val mockitoInline : String by project
4040
val mockkVersion : String by project
4141
val spairVersion : String by project
42+
val lwjglVersion : String by project
4243

4344

4445
val libs = file("libs")
@@ -60,10 +61,17 @@ version = modVersion
6061

6162
base.archivesName = modId
6263

64+
// We need to force it using lwjgl 3.3.3 because of 3.3.4 poor support for Wayland protocol
65+
configurations.all {
66+
resolutionStrategy.eachDependency {
67+
if (requested.group == "org.lwjgl") {
68+
useVersion(lwjglVersion)
69+
}
70+
}
71+
}
72+
6373
repositories {
6474
mavenLocal() // Allow the use of local repositories
65-
maven("https://maven.shedaniel.me/") // Architectury
66-
maven("https://maven.terraformersmc.com/releases/")
6775
maven("https://maven.2b2t.vc/releases") // Baritone
6876
maven("https://jitpack.io") // KDiscordIPC
6977
maven("https://raw.githubusercontent.com/kotlin-graphics/mary/master")
@@ -106,7 +114,7 @@ loom {
106114
property("mixin.debug.export", "true")
107115

108116
vmArgs("-XX:+HeapDumpOnOutOfMemoryError", "-XX:+CreateCoredumpOnCrash", "-XX:+UseOSErrorReporting")
109-
programArgs("--username", "Steve", "--uuid", "8667ba71b85a4004af54457a9734eed7", "--accessToken", "****", "--userType", "msa")
117+
programArgs("--username", "Steve", "--uuid", "8667ba71b85a4004af54457a9734eed7", "--accessToken", "<TOKEN>")
110118
}
111119
}
112120
}
@@ -204,6 +212,7 @@ tasks {
204212
outputs.upToDateWhen { false }
205213
}
206214

215+
// Visual debugger for OpenGL
207216
register<Exec>("renderDoc") {
208217
// You need renderdoc installed on your system and available in your environment variables in order
209218
// to use this task.

gradle.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
modId=lambda
2020
modName=Lambda
2121
modVersion=1.0.0
22-
modDescription=Minecraft utility mod coded in Kotlin
22+
modDescription=Minecraft utility mod for automation
2323
modIcon=assets/lambda/lambda.png
2424
mavenGroup=com.lambda
25-
modAuthors=Avanatiker, Blade, beanbag44, Edouard127
25+
modAuthors=Constructor (Avanatiker), Blade, beanbag44, Edouard127
2626

2727
# General
2828
minecraftVersion=1.21.5
2929
minecraftVersionMin=1.21.5
3030
minecraftVersionMax=1.21.6
31+
lwjglVersion=3.3.3
3132
mixinExtrasVersion=0.5.0-rc.2
3233
kotlinVersion=2.2.0
3334
pngEncoderVersion=0.16.0

settings.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ rootProject.name = "Lambda"
1919

2020
pluginManagement {
2121
repositories {
22-
maven("https://maven.neoforged.net/releases/")
23-
maven("https://maven.minecraftforge.net/")
2422
maven("https://maven.fabricmc.net/")
25-
maven("https://maven.architectury.dev/")
2623
maven("https://jitpack.io")
2724
mavenCentral()
2825
gradlePluginPortal()

src/main/kotlin/com/lambda/config/AbstractSetting.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ import com.lambda.command.CommandRegistry
3131
import com.lambda.command.commands.ConfigCommand
3232
import com.lambda.context.SafeContext
3333
import com.lambda.gui.Layout
34-
import com.lambda.gui.dsl.ImGuiBuilder
3534
import com.lambda.threading.runSafe
3635
import com.lambda.util.Communication.info
3736
import com.lambda.util.Nameable
37+
import com.lambda.util.NamedEnum
3838
import com.lambda.util.extension.CommandBuilder
3939
import com.lambda.util.text.ClickEvents
4040
import com.lambda.util.text.HoverEvents
@@ -98,11 +98,9 @@ abstract class AbstractSetting<T : Any>(
9898
val type: Type,
9999
val description: String,
100100
val visibility: () -> Boolean,
101-
) : Jsonable,
102-
Nameable,
103-
Layout
104-
{
101+
) : Jsonable, Nameable, Layout {
105102
private val listeners = mutableListOf<ValueListener<T>>()
103+
val groups: MutableList<List<NamedEnum>> = mutableListOf()
106104

107105
var value by Delegates.observable(defaultValue) { _, from, to ->
108106
listeners.forEach {
@@ -111,7 +109,6 @@ abstract class AbstractSetting<T : Any>(
111109
}
112110
}
113111

114-
private val isVisible get() = visibility()
115112
val isModified get() = value != defaultValue
116113

117114
operator fun getValue(thisRef: Any?, property: KProperty<*>) = value
@@ -153,6 +150,10 @@ abstract class AbstractSetting<T : Any>(
153150
listeners.add(ValueListener(false, block))
154151
}
155152

153+
fun group(vararg path: NamedEnum) = apply {
154+
groups.add(path.toList())
155+
}
156+
156157
fun reset() {
157158
if (value == defaultValue) {
158159
ConfigCommand.info(notChangedMessage())

src/main/kotlin/com/lambda/config/groups/BreakSettings.kt

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -26,82 +26,82 @@ import com.lambda.interaction.request.breaking.BreakConfig.BreakMode
2626
import com.lambda.interaction.request.breaking.BreakConfig.SortMode
2727
import com.lambda.interaction.request.breaking.BreakConfig.SwingMode
2828
import com.lambda.util.BlockUtils.allSigns
29+
import com.lambda.util.NamedEnum
2930
import java.awt.Color
3031

3132
class BreakSettings(
3233
c: Configurable,
34+
baseGroup: NamedEnum,
3335
vis: () -> Boolean = { true }
3436
) : BreakConfig {
35-
val page by c.setting("Break Page", Page.General, visibility = vis)
37+
enum class Group(override val displayName: String) : NamedEnum {
38+
General("General"),
39+
Cosmetic("Cosmetic")
40+
}
3641

3742
// General
38-
override val breakMode by c.setting("Break Mode", BreakMode.Packet) { vis() && page == Page.General }
39-
override val sorter by c.setting("Sorter", SortMode.Closest, "The order in which breaks are performed") { vis() && page == Page.General }
40-
override val reBreak by c.setting("ReBreak", true, "Re-breaks blocks after they've been broken once") { vis() && page == Page.General }
43+
override val breakMode by c.setting("Break Mode", BreakMode.Packet, visibility = vis).group(baseGroup, Group.General)
44+
override val sorter by c.setting("Sorter", SortMode.Closest, "The order in which breaks are performed", visibility = vis).group(baseGroup, Group.General)
45+
override val reBreak by c.setting("ReBreak", true, "Re-breaks blocks after they've been broken once", visibility = vis).group(baseGroup, Group.General)
4146

4247
// Double break
43-
override val doubleBreak by c.setting("Double Break", true, "Allows breaking two blocks at once") { vis() && page == Page.General }
44-
override val unsafeCancels by c.setting("Unsafe Cancels", true, "Allows cancelling block breaking even if the server might continue breaking sever side, potentially causing unexpected state changes") { vis() && page == Page.General }
48+
override val doubleBreak by c.setting("Double Break", true, "Allows breaking two blocks at once", visibility = vis).group(baseGroup, Group.General)
49+
override val unsafeCancels by c.setting("Unsafe Cancels", true, "Allows cancelling block breaking even if the server might continue breaking sever side, potentially causing unexpected state changes", visibility = vis).group(baseGroup, Group.General)
4550

4651
// Fixes / Delays
47-
override val breakThreshold by c.setting("Break Threshold", 0.70f, 0.1f..1.0f, 0.01f, "The break amount at which the block is considered broken") { vis() && page == Page.General }
48-
override val fudgeFactor by c.setting("Fudge Factor", 2, 0..5, 1, "The amount of ticks to give double, aka secondary breaks extra for the server to recognise the break") { vis() && page == Page.General }
52+
override val breakThreshold by c.setting("Break Threshold", 0.70f, 0.1f..1.0f, 0.01f, "The break amount at which the block is considered broken", visibility = vis).group(baseGroup, Group.General)
53+
override val fudgeFactor by c.setting("Fudge Factor", 2, 0..5, 1, "The amount of ticks to give double, aka secondary breaks extra for the server to recognise the break", visibility = vis).group(baseGroup, Group.General)
4954
// override val desyncFix by c.setting("Desync Fix", false, "Predicts if the players breaking will be slowed next tick as block break packets are processed using the players next position") { vis() && page == Page.General }
50-
override val breakDelay by c.setting("Break Delay", 0, 0..6, 1, "The delay between breaking blocks", " ticks") { vis() && page == Page.General }
55+
override val breakDelay by c.setting("Break Delay", 0, 0..6, 1, "The delay between breaking blocks", " ticks", visibility = vis).group(baseGroup, Group.General)
5156

5257
// Timing
53-
override val breakStageMask by c.setting("Break Stage Mask", setOf(TickEvent.Input.Post, TickEvent.Player.Post), description = "The sub-tick timing at which break actions can be performed") { vis() && page == Page.General }
58+
override val breakStageMask by c.setting("Break Stage Mask", setOf(TickEvent.Input.Post, TickEvent.Player.Post), description = "The sub-tick timing at which break actions can be performed", visibility = vis).group(baseGroup, Group.General)
5459

5560
// Swap
56-
override val swapMode by c.setting("Swap Mode", BreakConfig.SwapMode.End, "Decides when to swap to the best suited tool when breaking a block") { vis() && page == Page.General }
61+
override val swapMode by c.setting("Swap Mode", BreakConfig.SwapMode.End, "Decides when to swap to the best suited tool when breaking a block", visibility = vis).group(baseGroup, Group.General)
5762

5863
// Swing
59-
override val swing by c.setting("Swing Mode", SwingMode.Constant, "The times at which to swing the players hand") { vis() && page == Page.General }
60-
override val swingType by c.setting("Break Swing Type", BuildConfig.SwingType.Vanilla, "The style of swing") { vis() && page == Page.General && swing != SwingMode.None }
64+
override val swing by c.setting("Swing Mode", SwingMode.Constant, "The times at which to swing the players hand", visibility = vis).group(baseGroup, Group.General)
65+
override val swingType by c.setting("Break Swing Type", BuildConfig.SwingType.Vanilla, "The style of swing") { vis() && swing != SwingMode.None }.group(baseGroup, Group.General)
6166

6267
// Rotate
63-
override val rotateForBreak by c.setting("Rotate For Break", false, "Rotate towards block while breaking") { vis() && page == Page.General }
68+
override val rotateForBreak by c.setting("Rotate For Break", false, "Rotate towards block while breaking", visibility = vis).group(baseGroup, Group.General)
6469

6570
// Pending / Post
66-
override val breakConfirmation by c.setting("Break Confirmation", BreakConfirmationMode.BreakThenAwait, "The style of confirmation used when breaking") { vis() && page == Page.General }
67-
override val breaksPerTick by c.setting("Breaks Per Tick", 5, 1..30, 1, "Maximum instant block breaks per tick") { vis() && page == Page.General }
68-
override val maxPendingBreaks by c.setting("Max Pending Breaks", 15, 1..30, 1, "The maximum amount of pending breaks") { vis() && page == Page.General }
71+
override val breakConfirmation by c.setting("Break Confirmation", BreakConfirmationMode.BreakThenAwait, "The style of confirmation used when breaking", visibility = vis).group(baseGroup, Group.General)
72+
override val breaksPerTick by c.setting("Breaks Per Tick", 5, 1..30, 1, "Maximum instant block breaks per tick", visibility = vis).group(baseGroup, Group.General)
73+
override val maxPendingBreaks by c.setting("Max Pending Breaks", 15, 1..30, 1, "The maximum amount of pending breaks", visibility = vis).group(baseGroup, Group.General)
6974

7075
// Block
71-
override val avoidLiquids by c.setting("Avoid Liquids", true, "Avoids breaking blocks that would cause liquid to spill") { vis() && page == Page.General }
72-
override val avoidSupporting by c.setting("Avoid Supporting", true, "Avoids breaking the block supporting the player") { vis() && page == Page.General }
73-
override val breakWeakBlocks by c.setting("Break Weak Blocks", false, "Break blocks that dont have structural integrity (e.g: grass)") { vis() && page == Page.General }
74-
override val ignoredBlocks by c.setting("Ignored Blocks", allSigns, description = "Blocks that wont be broken") { vis() && page == Page.General }
76+
override val avoidLiquids by c.setting("Avoid Liquids", true, "Avoids breaking blocks that would cause liquid to spill", visibility = vis).group(baseGroup, Group.General)
77+
override val avoidSupporting by c.setting("Avoid Supporting", true, "Avoids breaking the block supporting the player", visibility = vis).group(baseGroup, Group.General)
78+
override val breakWeakBlocks by c.setting("Break Weak Blocks", false, "Break blocks that dont have structural integrity (e.g: grass)", visibility = vis).group(baseGroup, Group.General)
79+
override val ignoredBlocks by c.setting("Ignored Blocks", allSigns, description = "Blocks that wont be broken", visibility = vis).group(baseGroup, Group.General)
7580

7681
// Tool
77-
override val suitableToolsOnly by c.setting("Suitable Tools Only", false, "Places a restriction to only use tools suitable for the given block") { vis() && page == Page.General }
78-
override val forceSilkTouch by c.setting("Force Silk Touch", false, "Force silk touch when breaking blocks") { vis() && page == Page.General }
79-
override val forceFortunePickaxe by c.setting("Force Fortune Pickaxe", false, "Force fortune pickaxe when breaking blocks") { vis() && page == Page.General }
80-
override val minFortuneLevel by c.setting("Min Fortune Level", 1, 1..3, 1, "The minimum fortune level to use") { vis() && page == Page.General && forceFortunePickaxe }
82+
override val suitableToolsOnly by c.setting("Suitable Tools Only", false, "Places a restriction to only use tools suitable for the given block", visibility = vis).group(baseGroup, Group.General)
83+
override val forceSilkTouch by c.setting("Force Silk Touch", false, "Force silk touch when breaking blocks", visibility = vis).group(baseGroup, Group.General)
84+
override val forceFortunePickaxe by c.setting("Force Fortune Pickaxe", false, "Force fortune pickaxe when breaking blocks", visibility = vis).group(baseGroup, Group.General)
85+
override val minFortuneLevel by c.setting("Min Fortune Level", 1, 1..3, 1, "The minimum fortune level to use") { vis() && forceFortunePickaxe }.group(baseGroup, Group.General)
8186

8287
// Cosmetics
83-
override val sounds by c.setting("Break Sounds", true, "Plays the breaking sounds") { vis() && page == Page.Cosmetic }
84-
override val particles by c.setting("Particles", true, "Renders the breaking particles") { vis() && page == Page.Cosmetic }
85-
override val breakingTexture by c.setting("Breaking Overlay", true, "Overlays the breaking texture at its different stages") { vis() && page == Page.Cosmetic }
88+
override val sounds by c.setting("Break Sounds", true, "Plays the breaking sounds", visibility = vis).group(baseGroup, Group.Cosmetic)
89+
override val particles by c.setting("Particles", true, "Renders the breaking particles", visibility = vis).group(baseGroup, Group.Cosmetic)
90+
override val breakingTexture by c.setting("Breaking Overlay", true, "Overlays the breaking texture at its different stages", visibility = vis).group(baseGroup, Group.Cosmetic)
8691
// Modes
87-
override val renders by c.setting("Renders", true, "Enables the render settings for breaking progress") { vis() && page == Page.Cosmetic }
88-
override val animation by c.setting("Animation", AnimationMode.Out, "The style of animation used for the box") { vis() && page == Page.Cosmetic && renders }
92+
override val renders by c.setting("Renders", true, "Enables the render settings for breaking progress", visibility = vis).group(baseGroup, Group.Cosmetic)
93+
override val animation by c.setting("Animation", AnimationMode.Out, "The style of animation used for the box") { vis() && renders }.group(baseGroup, Group.Cosmetic)
8994
// Fill
90-
override val fill by c.setting("Fill", true, "Renders the sides of the box to display break progress") { vis() && page == Page.Cosmetic && renders }
91-
override val dynamicFillColor by c.setting("Dynamic Colour", true, "Enables fill color interpolation from start to finish for fill when breaking a block") { vis() && page == Page.Cosmetic && renders && fill }
92-
override val staticFillColor by c.setting("Fill Color", Color(255, 0, 0, 60).brighter(), "The color of the fill") { vis() && page == Page.Cosmetic && renders && !dynamicFillColor && fill }
93-
override val startFillColor by c.setting("Start Fill Color", Color(255, 0, 0, 60).brighter(), "The color of the fill at the start of breaking") { vis() && page == Page.Cosmetic && renders && dynamicFillColor && fill }
94-
override val endFillColor by c.setting("End Fill Color", Color(0, 255, 0, 60).brighter(), "The color of the fill at the end of breaking") { vis() && page == Page.Cosmetic && renders && dynamicFillColor && fill }
95+
override val fill by c.setting("Fill", true, "Renders the sides of the box to display break progress") { vis() && renders }.group(baseGroup, Group.Cosmetic)
96+
override val dynamicFillColor by c.setting("Dynamic Colour", true, "Enables fill color interpolation from start to finish for fill when breaking a block") { vis() && renders && fill }.group(baseGroup, Group.Cosmetic)
97+
override val staticFillColor by c.setting("Fill Color", Color(255, 0, 0, 60).brighter(), "The color of the fill") { vis() && renders && !dynamicFillColor && fill }.group(baseGroup, Group.Cosmetic)
98+
override val startFillColor by c.setting("Start Fill Color", Color(255, 0, 0, 60).brighter(), "The color of the fill at the start of breaking") { vis() && renders && dynamicFillColor && fill }.group(baseGroup, Group.Cosmetic)
99+
override val endFillColor by c.setting("End Fill Color", Color(0, 255, 0, 60).brighter(), "The color of the fill at the end of breaking") { vis() && renders && dynamicFillColor && fill }.group(baseGroup, Group.Cosmetic)
95100
// Outline
96-
override val outline by c.setting("Outline", true, "Renders the lines of the box to display break progress") { vis() && page == Page.Cosmetic && renders }
97-
override val outlineWidth by c.setting("Outline Width", 2, 0..5, 1, "The width of the outline") { vis() && page == Page.Cosmetic && renders && outline }
98-
override val dynamicOutlineColor by c.setting("Dynamic Outline Color", true, "Enables color interpolation from start to finish for the outline when breaking a block") { vis() && page == Page.Cosmetic && renders && outline }
99-
override val staticOutlineColor by c.setting("Outline Color", Color.RED.brighter(), "The Color of the outline at the start of breaking") { vis() && page == Page.Cosmetic && renders && !dynamicOutlineColor && outline }
100-
override val startOutlineColor by c.setting("Start Outline Color", Color.RED.brighter(), "The color of the outline at the start of breaking") { vis() && page == Page.Cosmetic && renders && dynamicOutlineColor && outline }
101-
override val endOutlineColor by c.setting("End Outline Color", Color.GREEN.brighter(), "The color of the outline at the end of breaking") { vis() && page == Page.Cosmetic && renders && dynamicOutlineColor && outline }
102-
103-
enum class Page {
104-
General,
105-
Cosmetic
106-
}
101+
override val outline by c.setting("Outline", true, "Renders the lines of the box to display break progress") { vis() && renders }.group(baseGroup, Group.Cosmetic)
102+
override val outlineWidth by c.setting("Outline Width", 2, 0..5, 1, "The width of the outline") { vis() && renders && outline }.group(baseGroup, Group.Cosmetic)
103+
override val dynamicOutlineColor by c.setting("Dynamic Outline Color", true, "Enables color interpolation from start to finish for the outline when breaking a block") { vis() && renders && outline }.group(baseGroup, Group.Cosmetic)
104+
override val staticOutlineColor by c.setting("Outline Color", Color.RED.brighter(), "The Color of the outline at the start of breaking") { vis() && renders && !dynamicOutlineColor && outline }.group(baseGroup, Group.Cosmetic)
105+
override val startOutlineColor by c.setting("Start Outline Color", Color.RED.brighter(), "The color of the outline at the start of breaking") { vis() && renders && dynamicOutlineColor && outline }.group(baseGroup, Group.Cosmetic)
106+
override val endOutlineColor by c.setting("End Outline Color", Color.GREEN.brighter(), "The color of the outline at the end of breaking") { vis() && renders && dynamicOutlineColor && outline }.group(baseGroup, Group.Cosmetic)
107107
}

0 commit comments

Comments
 (0)