Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
fixes #27
Browse files Browse the repository at this point in the history
  • Loading branch information
btwonion committed Jul 31, 2024
1 parent c840851 commit 71bf1b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions beta-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
none

## Bug Fixes
- fix Crystal state not recognized correctly on find
- fix double powder not recognized correctly
- fix crystal state not being recognized correctly
- fix double powder not being recognized correctly
- update structure select message

## Technical changes
none
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package dev.nyon.skylper.skyblock.mining.hollows.locations

import dev.nyon.skylper.config.config
import dev.nyon.skylper.extensions.*
import dev.nyon.skylper.extensions.event.EventHandler
import dev.nyon.skylper.extensions.event.EventHandler.listenEvent
import dev.nyon.skylper.extensions.event.LocatedHollowsStructureEvent
import dev.nyon.skylper.extensions.event.MessageEvent
import dev.nyon.skylper.extensions.groups
import dev.nyon.skylper.extensions.regex
import dev.nyon.skylper.minecraft
import dev.nyon.skylper.skyblock.mining.hollows.HollowsModule
import net.minecraft.ChatFormatting
Expand All @@ -25,7 +26,11 @@ object PlayerChatLocationListener {
val loc = regex.groups(rawMessage).let {
if (it.isEmpty()) return@let null

return@let Vec3(it[2].toDoubleOrNull() ?: 0.0, it[3].toDoubleOrNull() ?: 35.0, it[4].toDoubleOrNull() ?: 0.0)
return@let Vec3(
it[2].toDoubleOrNull() ?: 0.0,
it[3].toDoubleOrNull() ?: 35.0,
it[4].toDoubleOrNull() ?: 0.0
)
} ?: return@listenEvent

if (!HollowsModule.hollowsBox.contains(loc)) return@listenEvent
Expand Down Expand Up @@ -56,15 +61,13 @@ object PlayerChatLocationListener {

val locationsComponent = PreDefinedHollowsLocationSpecific.entries.map { specific ->
specific.displayName.copy().withStyle {
it.withColor(ChatFormatting.RED)
val command =
"/skylper hollows waypoints set ${specific.key} ${pos.x.toInt()} ${pos.y.toInt()} ${pos.z.toInt()}"
it.withClickEvent(ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command))
}
}.fold(Component.empty()) { acc, new ->
if (acc != Component.empty()) acc.append(Component.literal(", ").withStyle(ChatFormatting.WHITE))
acc.append(new)
acc
acc.append(new.withStyle(ChatFormatting.RED))
}

val finalComponent = Component.translatable("chat.skylper.hollows.locations.pick", locationsComponent)
Expand Down

0 comments on commit 71bf1b0

Please sign in to comment.