Skip to content

Commit 294c6bb

Browse files
committed
Fixed messages with translations
1 parent 6047de3 commit 294c6bb

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.0.1] - 2024-10-29
10+
### Fixed
11+
- Messages with translations
12+
913
## [2.0.0] - 2024-09-30
1014
Initial public release

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Mod
22
modName = BlockBot Discord
33
modId = blockbot-discord
4-
modVersion = 2.0.0
4+
modVersion = 2.0.1
55
mavenGroup = io.github.quiltservertools
66

77
# Other

libs.versions.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[versions]
2-
minecraft = "1.21.2-rc2"
3-
curseforge-minecraft="1.21.2-Snapshot"
2+
minecraft = "1.21.3"
3+
curseforge-minecraft="1.21.3"
44
fabric-loader = "0.16.7"
5-
yarn-mappings = "1.21.2-rc2+build.2"
5+
yarn-mappings = "1.21.3+build.2"
66

7-
fabric-api = "0.106.1+1.21.2"
7+
fabric-api = "0.107.0+1.21.3"
88

99
# Kotlin
1010
fabric-kotlin = "1.12.1+kotlin.2.0.20"
@@ -13,7 +13,7 @@ fabric-kotlin = "1.12.1+kotlin.2.0.20"
1313
kord-extensions = "1.9.0-SNAPSHOT"
1414
mc-discord-reserializer = "4.3.0"
1515
emoji-java = "5.1.1"
16-
adventure-gson = "4.16.0"
16+
adventure-gson = "4.17.0"
1717

1818
placeholder-api = "2.5.0+1.21.2"
1919
permission-api = "0.3.1"

src/main/kotlin/io/github/quiltservertools/blockbotdiscord/extensions/BlockBotApiExtension.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ class BlockBotApiExtension : Extension(), Bot {
7171
.addRenderer(MentionToMinecraftRenderer(bot))
7272
)
7373
private val discordSerializer = DiscordSerializer(
74-
DiscordSerializerOptions.defaults().withKeybindProvider { Text.translatable(it.keybind()).string }
74+
DiscordSerializerOptions.defaults()
75+
.withKeybindProvider { Text.translatable(it.keybind()).string }
76+
.withTranslationProvider { it.toNative(server.registryManager).string }
7577
)
7678
private val server: MinecraftServer by inject()
7779
private val mentions = AllowedMentionsBuilder()

src/main/kotlin/io/github/quiltservertools/blockbotdiscord/utility/Extensions.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fun Message.summary(): String {
2525

2626
fun GameProfile.getTextures() = Iterables.getFirst(this.properties.get("textures"), null)?.value
2727

28-
fun Component.toNative(wrapperLookup: RegistryWrapper.WrapperLookup): MutableText = Text.Serialization.fromJson(GsonComponentSerializer.gson().serialize(this), DynamicRegistryManager.EMPTY)?: Text.empty()
28+
fun Component.toNative(wrapperLookup: RegistryWrapper.WrapperLookup): MutableText = Text.Serialization.fromJson(GsonComponentSerializer.gson().serialize(this), wrapperLookup)?: Text.empty()
2929

3030
fun Text.toAdventure(wrapperLookup: RegistryWrapper.WrapperLookup) = GsonComponentSerializer.gson().deserialize(Text.Serialization.toJsonString(this, wrapperLookup))
3131

0 commit comments

Comments
 (0)