Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/kotlin/com/lambda/config/AutomationConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ open class AutomationConfig(
val showAllEntries by setting("Show All Entries", false, "Show all entries in the task tree").group(Group.Debug)
val shrinkFactor by setting("Shrink Factor", 0.001, 0.0..1.0, 0.001).group(Group.Debug)
val ignoreItemDropWarnings by setting("Ignore Drop Warnings", false, "Hides the item drop warnings from the break manager").group(Group.Debug)
val managerDebugLogs by setting("Manager Debug Logs", false, "Prints debug logs from managers into chat").group(Group.Debug)

@Volatile
var drawables = listOf<Drawable>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package com.lambda.interaction.managers.breaking

import com.lambda.config.AutomationConfig.Companion.DEFAULT
import com.lambda.config.AutomationConfig.Companion.DEFAULT.managerDebugLogs
import com.lambda.context.SafeContext
import com.lambda.event.events.EntityEvent
import com.lambda.event.events.WorldEvent
Expand Down Expand Up @@ -60,11 +61,11 @@ object BrokenBlockHandler : PostActionHandler<BreakInfo>() {
if (!info.broken) {
val message = "${info.type} ${info::class.simpleName} at ${info.context.blockPos.toShortString()} timed out with cached state ${info.context.cachedState}"
BreakManager.logger.error(message)
warn(message)
if (managerDebugLogs) this@BrokenBlockHandler.warn(message)
} else if (!DEFAULT.ignoreItemDropWarnings) {
val message = "${info.type} ${info::class.simpleName}'s item drop at ${info.context.blockPos.toShortString()} timed out"
BreakManager.logger.warn(message)
warn(message)
BreakManager.logger.warning(message)
if (managerDebugLogs) this@BrokenBlockHandler.warn(message)
}

if (!info.broken && info.breakConfig.breakConfirmation != BreakConfirmationMode.AwaitThenBreak) {
Expand Down Expand Up @@ -97,7 +98,7 @@ object BrokenBlockHandler : PostActionHandler<BreakInfo>() {
} else {
val message = "Broken block at ${event.pos.toShortString()} was rejected with ${event.newState} instead of ${pending.context.cachedState.emptyState}"
BreakManager.logger.error(message)
this@BrokenBlockHandler.warn(message)
if (managerDebugLogs) this@BrokenBlockHandler.warn(message)
pending.stopPending()
}
return@listen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
package com.lambda.interaction.managers.interacting

import com.lambda.config.AutomationConfig.Companion.DEFAULT
import com.lambda.config.AutomationConfig.Companion.DEFAULT.managerDebugLogs
import com.lambda.event.events.WorldEvent
import com.lambda.event.listener.SafeListener.Companion.listen
import com.lambda.interaction.construction.simulation.processing.ProcessorRegistry
import com.lambda.interaction.managers.PostActionHandler
import com.lambda.interaction.managers.interacting.InteractManager.placeSound
import com.lambda.threading.runSafe
import com.lambda.util.BlockUtils.matches
import com.lambda.util.Communication.info
import com.lambda.util.Communication.warn
import com.lambda.util.collections.LimitedDecayQueue

Expand All @@ -34,7 +34,7 @@ object InteractedBlockHandler : PostActionHandler<InteractInfo>() {
DEFAULT.buildConfig.maxPendingActions,
DEFAULT.buildConfig.actionTimeout * 50L
) {
info("${it::class.simpleName} at ${it.context.blockPos.toShortString()} timed out")
if (managerDebugLogs) warn("${it::class.simpleName} at ${it.context.blockPos.toShortString()} timed out")
if (it.interactConfig.interactConfirmationMode != InteractConfig.InteractConfirmationMode.AwaitThenPlace) {
runSafe {
world.setBlockState(it.context.blockPos, it.context.cachedState)
Expand All @@ -60,7 +60,7 @@ object InteractedBlockHandler : PostActionHandler<InteractInfo>() {

pending.stopPending()

this@InteractedBlockHandler.warn("Placed block at ${event.pos.toShortString()} was rejected with ${event.newState} instead of ${pending.context.expectedState}")
if (managerDebugLogs) this@InteractedBlockHandler.warn("Placed block at ${event.pos.toShortString()} was rejected with ${event.newState} instead of ${pending.context.expectedState}")
return@listen
}

Expand Down