From 76b793440756a50e48b377520894a6f740748e9c Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Tue, 12 Nov 2024 21:56:46 +0100 Subject: docs: Add information about id replacements --- docs/Texture Pack Format.md | 6 ++++-- src/main/kotlin/gui/config/FirmamentConfigScreenProvider.kt | 13 ++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/Texture Pack Format.md b/docs/Texture Pack Format.md index b52c038..b0b135f 100644 --- a/docs/Texture Pack Format.md +++ b/docs/Texture Pack Format.md @@ -12,8 +12,10 @@ Find the internal id of the item. This is usually stored in the ExtraAttributes keybinds). Once you found it, create an item model in a resource pack like you would for a vanilla item model, but at the coordinate `firmskyblock:`. So for an aspect of the end, this would be `firmskyblock:models/item/aspect_of_the_end.json` (or `assets/firmskyblock/models/item/aspect_of_the_end.json`). Then, -just use a normal minecraft item model. See https://github.com/romangraef/BadSkyblockTP/blob/master/assets/firmskyblock/models/item/magma_rod.json -as an example. +just use a normal minecraft item model. See https://github.com/nea89o/BadSkyblockTP/blob/master/assets/firmskyblock/models/item/magma_rod.json +as an example. The id is first turned to lower case, then gets `:` replaced with `___`, `;` with `__` and all other +characters that cannot be used in a minecraft resource location with `__XXXX` where `XXXX` is the 4 digit hex code for +the character. ## (Placed) Skulls by texture id diff --git a/src/main/kotlin/gui/config/FirmamentConfigScreenProvider.kt b/src/main/kotlin/gui/config/FirmamentConfigScreenProvider.kt index 5aaa5fa..faad1cc 100644 --- a/src/main/kotlin/gui/config/FirmamentConfigScreenProvider.kt +++ b/src/main/kotlin/gui/config/FirmamentConfigScreenProvider.kt @@ -13,13 +13,12 @@ interface FirmamentConfigScreenProvider { val providers by lazy { allValidInstances .filter { it.isEnabled } - .sortedWith(Comparator.comparing( - { it.key }, - Comparator { left, right -> - if (left == "builtin") return@Comparator -1 - if (right == "builtin") return@Comparator 1 - return@Comparator left.compareTo(right) - })).toList() + .sortedWith( + Comparator + .comparing({ it.key == "builtin" }) + .reversed() + .then(Comparator.comparing({ it.key })) + ).toList() } } } -- cgit