1717
1818package com.lambda.module.modules.player
1919
20- import com.lambda.config.groups.BreakSettings
21- import com.lambda.config.groups.BuildSettings
22- import com.lambda.config.groups.HotbarSettings
23- import com.lambda.config.groups.InteractSettings
24- import com.lambda.config.groups.InventorySettings
25- import com.lambda.config.groups.PlaceSettings
26- import com.lambda.config.groups.RotationSettings
20+ import com.lambda.config.AutomationConfig.Companion.automationConfig
2721import com.lambda.interaction.construction.blueprint.TickingBlueprint
2822import com.lambda.interaction.construction.verify.TargetState
2923import com.lambda.interaction.request.placing.PlaceConfig
@@ -33,7 +27,6 @@ import com.lambda.task.RootTask.run
3327import com.lambda.task.Task
3428import com.lambda.task.tasks.BuildTask.Companion.build
3529import com.lambda.util.BlockUtils.blockPos
36- import com.lambda.util.NamedEnum
3730import fi.dy.masa.litematica.world.SchematicWorldHandler
3831import net.minecraft.util.math.BlockPos
3932
@@ -47,37 +40,23 @@ object Printer : Module(
4740 true
4841 }.getOrDefault(false )
4942
50- private val range by setting(" Range" , 5 , 1 .. 7 , 1 ).group(Group .General )
51- private val air by setting(" Air" , false ).group(Group .General )
52-
53- override val buildConfig = BuildSettings (this , Group .Build ).apply {
54- editTyped(::pathing, ::stayInRange) { defaultValue(false ) }
55- }
56- override val breakConfig = BreakSettings (this , Group .Break ).apply {
57- editTyped(::efficientOnly, ::suitableToolsOnly) { defaultValue(false ) }
58- }
59- override val placeConfig = PlaceSettings (this , Group .Place ).apply {
60- ::airPlace.edit { defaultValue(PlaceConfig .AirPlaceMode .Grim ) }
61- }
62- override val interactConfig = InteractSettings (this , Group .Interact )
63- override val rotationConfig = RotationSettings (this , Group .Rotation )
64- override val inventoryConfig = InventorySettings (this , Group .Inventory )
65- override val hotbarConfig = HotbarSettings (this , Group .Hotbar )
43+ private val range by setting(" Range" , 5 , 1 .. 7 , 1 )
44+ private val air by setting(" Air" , false )
6645
6746 private var buildTask: Task <* >? = null
6847
69- private enum class Group (override val displayName : String ) : NamedEnum {
70- General (" General" ),
71- Build (" Build" ),
72- Break (" Break" ),
73- Place (" Place" ),
74- Interact (" Interact" ),
75- Rotation (" Rotation" ),
76- Inventory (" Inventory" ),
77- Hotbar (" Hotbar" )
78- }
79-
8048 init {
49+ defaultAutomationConfig = automationConfig {
50+ buildConfig.apply {
51+ editTyped(::pathing, ::stayInRange) { defaultValue(false ) }
52+ }
53+ breakConfig.apply {
54+ editTyped(::efficientOnly, ::suitableToolsOnly) { defaultValue(false ) }
55+ }
56+ placeConfig.apply {
57+ ::airPlace.edit { defaultValue(PlaceConfig .AirPlaceMode .Grim ) }
58+ }
59+ }
8160 onEnable {
8261 if (! isSchematicHandlerAvailable()) {
8362 error(" Litematica is not installed!" )
0 commit comments