From e5e51c78a7ec60fe3fbb33062d7b5b38169faa4d Mon Sep 17 00:00:00 2001 From: Ic3Tank <61137113+IceTank@users.noreply.github.com> Date: Sat, 7 Mar 2026 20:03:06 +0100 Subject: [PATCH 1/4] Rename air and add description to air setting in printer --- src/main/kotlin/com/lambda/module/modules/player/Printer.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/lambda/module/modules/player/Printer.kt b/src/main/kotlin/com/lambda/module/modules/player/Printer.kt index ff97940aa..d95fccb59 100644 --- a/src/main/kotlin/com/lambda/module/modules/player/Printer.kt +++ b/src/main/kotlin/com/lambda/module/modules/player/Printer.kt @@ -18,10 +18,8 @@ package com.lambda.module.modules.player import com.lambda.config.AutomationConfig.Companion.setDefaultAutomationConfig -import com.lambda.config.applyEdits import com.lambda.interaction.construction.blueprint.TickingBlueprint import com.lambda.interaction.construction.verify.TargetState -import com.lambda.interaction.managers.interacting.InteractConfig import com.lambda.module.Module import com.lambda.module.tag.ModuleTag import com.lambda.task.RootTask.run @@ -39,7 +37,7 @@ object Printer : Module( tag = ModuleTag.PLAYER ) { private val range by setting("Range", 5, 1..7, 1) - private val air by setting("Air", false) + private val considerAll by setting("Consider All", false, description = "Consider all blocks outside the schematic as schematic air blocks") private var buildTask: Task<*>? = null @@ -59,7 +57,7 @@ object Printer : Module( .asSequence() .filter { DataManager.getRenderLayerRange().isPositionWithinRange(it) } .associateWith { TargetState.State(schematicWorld.getBlockState(it)) } - .filter { air || !it.value.blockState.isAir } + .filter { considerAll || !it.value.blockState.isAir } }.build(finishOnDone = false).run() } From 02d6f01ad3c92f61eac09760f4ca9fcc6d167587 Mon Sep 17 00:00:00 2001 From: Ic3Tank <61137113+IceTank@users.noreply.github.com> Date: Sun, 8 Mar 2026 16:22:30 +0100 Subject: [PATCH 2/4] Renamed 'Air' setting back to 'Air' in printer --- src/main/kotlin/com/lambda/module/modules/player/Printer.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/lambda/module/modules/player/Printer.kt b/src/main/kotlin/com/lambda/module/modules/player/Printer.kt index d95fccb59..8ce72e133 100644 --- a/src/main/kotlin/com/lambda/module/modules/player/Printer.kt +++ b/src/main/kotlin/com/lambda/module/modules/player/Printer.kt @@ -37,7 +37,7 @@ object Printer : Module( tag = ModuleTag.PLAYER ) { private val range by setting("Range", 5, 1..7, 1) - private val considerAll by setting("Consider All", false, description = "Consider all blocks outside the schematic as schematic air blocks") + private val air by setting("Air", false, description = "Consider all blocks outside the schematic as schematic air blocks") private var buildTask: Task<*>? = null @@ -57,7 +57,7 @@ object Printer : Module( .asSequence() .filter { DataManager.getRenderLayerRange().isPositionWithinRange(it) } .associateWith { TargetState.State(schematicWorld.getBlockState(it)) } - .filter { considerAll || !it.value.blockState.isAir } + .filter { air || !it.value.blockState.isAir } }.build(finishOnDone = false).run() } From 123b5e27569d1a1d544b25e365745cfd1ef3d7ae Mon Sep 17 00:00:00 2001 From: Ic3Tank <61137113+IceTank@users.noreply.github.com> Date: Sun, 8 Mar 2026 17:10:02 +0100 Subject: [PATCH 3/4] Add a printer check to only consider blocks inside any schematic for printing --- .../com/lambda/module/modules/player/Printer.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/lambda/module/modules/player/Printer.kt b/src/main/kotlin/com/lambda/module/modules/player/Printer.kt index 8ce72e133..b3cd7e654 100644 --- a/src/main/kotlin/com/lambda/module/modules/player/Printer.kt +++ b/src/main/kotlin/com/lambda/module/modules/player/Printer.kt @@ -36,8 +36,8 @@ object Printer : Module( description = "Automatically prints schematics", tag = ModuleTag.PLAYER ) { - private val range by setting("Range", 5, 1..7, 1) - private val air by setting("Air", false, description = "Consider all blocks outside the schematic as schematic air blocks") + private val range by setting("Range", 5, 1..7, 1, description = "The range around the player to check for blocks to print") + private val air by setting("Air", false, description = "Consider breaking blocks in the world that are air in the schematic.\nNote: Breaking can also be disabled in the Automation Config.") private var buildTask: Task<*>? = null @@ -55,7 +55,7 @@ object Printer : Module( BlockPos.iterateOutwards(player.blockPos, range, range, range) .map { it.blockPos } .asSequence() - .filter { DataManager.getRenderLayerRange().isPositionWithinRange(it) } + .filter { DataManager.getRenderLayerRange().isPositionWithinRange(it) && inSchematic(it) } .associateWith { TargetState.State(schematicWorld.getBlockState(it)) } .filter { air || !it.value.blockState.isAir } }.build(finishOnDone = false).run() @@ -64,6 +64,14 @@ object Printer : Module( onDisable { buildTask?.cancel(); buildTask = null } } + private fun inSchematic(pos: BlockPos): Boolean { + val placementManager = DataManager.getSchematicPlacementManager() + placementManager?.getAllPlacementsTouchingChunk(pos)?.forEach { + if (it.bb.containsPos(pos)) return true + } + return false + } + private fun litematicaAvailable(): Boolean = runCatching { Class.forName("fi.dy.masa.litematica.Litematica") true From 7165df83d4f23210c4b9298d6504bba1dd3962f5 Mon Sep 17 00:00:00 2001 From: Ic3Tank <61137113+IceTank@users.noreply.github.com> Date: Sun, 8 Mar 2026 17:12:29 +0100 Subject: [PATCH 4/4] Only consider enabled placements when printing --- src/main/kotlin/com/lambda/module/modules/player/Printer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/lambda/module/modules/player/Printer.kt b/src/main/kotlin/com/lambda/module/modules/player/Printer.kt index b3cd7e654..16e94e737 100644 --- a/src/main/kotlin/com/lambda/module/modules/player/Printer.kt +++ b/src/main/kotlin/com/lambda/module/modules/player/Printer.kt @@ -67,7 +67,7 @@ object Printer : Module( private fun inSchematic(pos: BlockPos): Boolean { val placementManager = DataManager.getSchematicPlacementManager() placementManager?.getAllPlacementsTouchingChunk(pos)?.forEach { - if (it.bb.containsPos(pos)) return true + if (it.placement.isEnabled && it.bb.containsPos(pos)) return true } return false }