aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-12 21:56:46 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-12 21:56:46 +0100
commit76b793440756a50e48b377520894a6f740748e9c (patch)
tree33eb3bf3fa12af7f09b7b5f6530677d6d3eaa93d
parentfc88e54a2e88c87bcfd5e7dbd6866764faa3e503 (diff)
downloadFirmament-76b793440756a50e48b377520894a6f740748e9c.tar.gz
Firmament-76b793440756a50e48b377520894a6f740748e9c.tar.bz2
Firmament-76b793440756a50e48b377520894a6f740748e9c.zip
docs: Add information about id replacements
-rw-r--r--docs/Texture Pack Format.md6
-rw-r--r--src/main/kotlin/gui/config/FirmamentConfigScreenProvider.kt13
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:<internalid>`. 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<String> { left, right ->
- if (left == "builtin") return@Comparator -1
- if (right == "builtin") return@Comparator 1
- return@Comparator left.compareTo(right)
- })).toList()
+ .sortedWith(
+ Comparator
+ .comparing<FirmamentConfigScreenProvider, Boolean>({ it.key == "builtin" })
+ .reversed()
+ .then(Comparator.comparing({ it.key }))
+ ).toList()
}
}
}