Skip to content

Commit 1519d78

Browse files
Log only found and selected objects to reduce unnecessary entries in StashLogger module. (Issue #264) (#272)
* Update StashLogger.kt log only found and selected items instead of all. * This is kotlin not java * Change wrong whitespaces * More wrong whitespaces * Beautify Co-authored-by: Constructor <[email protected]>
1 parent a141ff5 commit 1519d78

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/kotlin/com/lambda/client/module/modules/misc/StashLogger.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ object StashLogger : Module(
8585

8686
if (logToChat) {
8787
val positionString = center.asString()
88-
MessageSendHelper.sendChatMessage("$chatName $positionString $string")
88+
MessageSendHelper.sendChatMessage("$chatName Found $string at ($positionString) ")
8989
}
9090

91-
found = found || true
91+
found = true
9292
}
9393

9494
if (found) {
@@ -166,7 +166,13 @@ object StashLogger : Module(
166166
}
167167

168168
override fun toString(): String {
169-
return "($chests chests, $shulkers shulkers, $droppers droppers, $dispensers dispensers, $hoppers hoppers)"
169+
val statList = mutableListOf<String>()
170+
if (chests > 0 && logChests) statList.add("$chests chest${if (chests == 1) "" else "s"}")
171+
if (shulkers > 0 && logShulkers) statList.add("$shulkers shulker${if (shulkers == 1) "" else "s"}")
172+
if (droppers > 0 && logDroppers) statList.add("$droppers dropper${if (droppers == 1) "" else "s"}")
173+
if (dispensers > 0 && logDispensers) statList.add("$dispensers dispenser${if (dispensers == 1) "" else "s"}")
174+
if (hoppers > 0 && logHoppers) statList.add("$hoppers hopper${if (hoppers == 1) "" else "s"}")
175+
return statList.joinToString()
170176
}
171177
}
172178
}

0 commit comments

Comments
 (0)