Skip to content

Commit

Permalink
more.
Browse files Browse the repository at this point in the history
  • Loading branch information
RayDeeUx committed May 27, 2024
1 parent bcd8d64 commit 15f7f7c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/features/misc/WhereWillIBe.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ object WhereWillIBe {
repeat(Random.nextInt(2, 11)) {
lastUsedMillis = randomMillis(lastUsedMillis)
lastIsland = chooseIsland(lastIsland, chooseIslandsList(islandsAsList))
if (lastIsland in onceOnlyIslands)
islandsAsList.remove(lastIsland)
ChatUtils.chat(
"§e${formattedDate(Date(lastUsedMillis))} - ${randomServerID(lastIsland)} - ${randomIsland(lastIsland)}",
false
Expand Down Expand Up @@ -93,9 +91,23 @@ object WhereWillIBe {
islandToReturn in nonIslands
)
islandToReturn = chosenIslandsList.shuffled().first()
removeIfNecessary(
islandToReturn,
chosenIslandsList.toMutableList()
)
return islandToReturn
}

private fun removeIfNecessary(
lastIsland: IslandType,
islandsAsList: MutableList<IslandType>
) {
if (lastIsland in onceOnlyIslands)
islandsAsList.remove(
lastIsland
)
}

private fun randomIsland(
chosenIsland: IslandType
): String =
Expand Down

0 comments on commit 15f7f7c

Please sign in to comment.