aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-14 19:09:40 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-14 19:09:40 +0200
commitd9191de0d4670d8e710c556210fea64b351090e2 (patch)
tree697a7559c9844506881d3af4cf7b57e0fd21e8ff /src/main/java/at/hannibal2/skyhanni/utils
parent182e27f2dbf13574e43e30ef1937237d4b9be21f (diff)
downloadskyhanni-d9191de0d4670d8e710c556210fea64b351090e2.tar.gz
skyhanni-d9191de0d4670d8e710c556210fea64b351090e2.tar.bz2
skyhanni-d9191de0d4670d8e710c556210fea64b351090e2.zip
Removed enchanted bread from Crop Money Per Hour List
Added enchanted seeds to Crop Per Hour Added option to merge seeds to wheat prices (default enabled)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
index 552782025..c84710fe0 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
@@ -213,4 +213,15 @@ object LorenzUtils {
HoverEvent(HoverEvent.Action.SHOW_TEXT, ChatComponentText("§eExecute /$command"))
Minecraft.getMinecraft().thePlayer.addChatMessage(text)
}
+
+ fun <K, V> Map<K, V>.moveEntryToTop(matcher: (Map.Entry<K, V>) -> Boolean): Map<K, V> {
+ val entry = entries.find(matcher)
+ if (entry != null) {
+ val newMap = linkedMapOf(entry.key to entry.value)
+ newMap.putAll(this)
+ return newMap
+ }
+ return this
+ }
+
} \ No newline at end of file