Skip to content

Commit bacff64

Browse files
committed
break settings re-order
1 parent 0d57201 commit bacff64

File tree

2 files changed

+42
-14
lines changed

2 files changed

+42
-14
lines changed

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

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,44 +33,63 @@ class BreakSettings(
3333
vis: () -> Boolean = { true }
3434
) : BreakConfig {
3535
val page by c.setting("Break Page", Page.General, visibility = vis)
36+
37+
// General
3638
override val breakMode by c.setting("Break Mode", BreakMode.Packet) { vis() && page == Page.General }
3739
override val sorter by c.setting("Sorter", SortMode.Closest, "The order in which breaks are performed") { vis() && page == Page.General }
38-
override val reBreak by c.setting("ReBreak", true, "Re-breaks blocks after they've been broken once") { vis() && page == Page.General }
3940
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 }
41+
override val reBreak by c.setting("ReBreak", true, "Re-breaks blocks after they've been broken once") { vis() && page == Page.General }
42+
43+
// Double break
4044
override val doubleBreak by c.setting("Double Break", true, "Allows breaking two blocks at once") { vis() && page == Page.General }
4145
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 }
46+
47+
// Fixes / Delays
4248
override val fudgeFactor by c.setting("Fudge Factor", 1, 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 }
4349
// 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 }
4450
override val breakDelay by c.setting("Break Delay", 0, 0..6, 1, "The delay between breaking blocks", " ticks") { vis() && page == Page.General }
51+
52+
// Timing
4553
override val breakStageMask by c.setting("Break Stage Mask", setOf(TickEvent.Input.Post, TickEvent.Player.Post), "The sub-tick timing at which break actions can be performed") { vis() && page == Page.General }
54+
55+
// Swing
4656
override val swing by c.setting("Swing Mode", SwingMode.Constant, "The times at which to swing the players hand") { vis() && page == Page.General }
4757
override val swingType by c.setting("Break Swing Type", BuildConfig.SwingType.Vanilla, "The style of swing") { vis() && page == Page.General && swing != SwingMode.None }
58+
59+
// Rotate
4860
override val rotateForBreak by c.setting("Rotate For Break", false, "Rotate towards block while breaking") { vis() && page == Page.General }
49-
override val ignoredBlocks by c.setting("Ignored Blocks", allSigns, "Blocks that wont be broken") { vis() && page == Page.General }
61+
62+
// Pending / Post
5063
override val breakConfirmation by c.setting("Break Confirmation", BreakConfirmationMode.BreakThenAwait, "The style of confirmation used when breaking") { vis() && page == Page.General }
51-
override val maxPendingBreaks by c.setting("Max Pending Breaks", 15, 1..30, 1, "The maximum amount of pending breaks") { vis() && page == Page.General }
5264
override val breaksPerTick by c.setting("Breaks Per Tick", 5, 1..30, 1, "Maximum instant block breaks per tick") { vis() && page == Page.General }
53-
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 }
65+
override val maxPendingBreaks by c.setting("Max Pending Breaks", 15, 1..30, 1, "The maximum amount of pending breaks") { vis() && page == Page.General }
66+
67+
// Block
5468
override val avoidLiquids by c.setting("Avoid Liquids", true, "Avoids breaking blocks that would cause liquid to spill") { vis() && page == Page.General }
5569
override val avoidSupporting by c.setting("Avoid Supporting", true, "Avoids breaking the block supporting the player") { vis() && page == Page.General }
5670
override val breakWeakBlocks by c.setting("Break Weak Blocks", false, "Break blocks that dont have structural integrity (e.g: grass)") { vis() && page == Page.General }
71+
override val ignoredBlocks by c.setting("Ignored Blocks", allSigns, "Blocks that wont be broken") { vis() && page == Page.General }
72+
73+
// Tool
74+
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 }
5775
override val forceSilkTouch by c.setting("Force Silk Touch", false, "Force silk touch when breaking blocks") { vis() && page == Page.General }
5876
override val forceFortunePickaxe by c.setting("Force Fortune Pickaxe", false, "Force fortune pickaxe when breaking blocks") { vis() && page == Page.General }
5977
override val minFortuneLevel by c.setting("Min Fortune Level", 1, 1..3, 1, "The minimum fortune level to use") { vis() && page == Page.General && forceFortunePickaxe }
6078

79+
// Cosmetics
6180
override val sounds by c.setting("Break Sounds", true, "Plays the breaking sounds") { vis() && page == Page.Cosmetic }
6281
override val particles by c.setting("Particles", true, "Renders the breaking particles") { vis() && page == Page.Cosmetic }
6382
override val breakingTexture by c.setting("Breaking Overlay", true, "Overlays the breaking texture at its different stages") { vis() && page == Page.Cosmetic }
64-
83+
// Modes
6584
override val renders by c.setting("Renders", true, "Enables the render settings for breaking progress") { vis() && page == Page.Cosmetic }
6685
override val animation by c.setting("Animation", AnimationMode.Out, "The style of animation used for the box") { vis() && page == Page.Cosmetic && renders }
67-
86+
// Fill
6887
override val fill by c.setting("Fill", true, "Renders the sides of the box to display break progress") { vis() && page == Page.Cosmetic && renders }
6988
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 }
7089
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 }
7190
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 }
7291
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 }
73-
92+
// Outline
7493
override val outline by c.setting("Outline", true, "Renders the lines of the box to display break progress") { vis() && page == Page.Cosmetic && renders }
7594
override val outlineWidth by c.setting("Outline Width", 2, 0..5, 1, "The width of the outline") { vis() && page == Page.Cosmetic && renders && outline }
7695
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 }

common/src/main/kotlin/com/lambda/interaction/request/breaking/BreakConfig.kt

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,41 @@ import java.awt.Color
2626
interface BreakConfig : RequestConfig {
2727
val breakMode: BreakMode
2828
val sorter: SortMode
29-
val reBreak: Boolean
3029
val breakThreshold: Float
30+
val reBreak: Boolean
31+
3132
val doubleBreak: Boolean
3233
val unsafeCancels: Boolean
34+
3335
val fudgeFactor: Int
3436
//ToDo: Needs a more advanced player simulation implementation to predict the next ticks onGround / submerged status
3537
// abstract val desyncFix: Boolean
3638
val breakDelay: Int
39+
3740
val breakStageMask: Set<Event>
41+
3842
val swing: SwingMode
3943
val swingType: BuildConfig.SwingType
40-
val sounds: Boolean
41-
val particles: Boolean
42-
val breakingTexture: Boolean
44+
4345
val rotateForBreak: Boolean
46+
4447
val breakConfirmation: BreakConfirmationMode
45-
val maxPendingBreaks: Int
4648
val breaksPerTick: Int
47-
val suitableToolsOnly: Boolean
49+
val maxPendingBreaks: Int
50+
4851
val avoidLiquids: Boolean
4952
val avoidSupporting: Boolean
5053
val breakWeakBlocks: Boolean
54+
val ignoredBlocks: Set<Block>
55+
56+
val suitableToolsOnly: Boolean
5157
val forceSilkTouch: Boolean
5258
val forceFortunePickaxe: Boolean
5359
val minFortuneLevel: Int
54-
val ignoredBlocks: Set<Block>
60+
61+
val sounds: Boolean
62+
val particles: Boolean
63+
val breakingTexture: Boolean
5564

5665
val renders: Boolean
5766
val fill: Boolean

0 commit comments

Comments
 (0)