[BUG] Handle Adventure serializer errors with a fallback value
This commit is contained in:
@@ -36,8 +36,12 @@ public class ChatUtils {
|
||||
}
|
||||
|
||||
public static net.kyori.adventure.text.Component mojangToAdventure(Component inComponent) {
|
||||
final String serialised = Component.Serializer.toJson(inComponent, getRegistryLookup());
|
||||
return adventureSerializer.deserialize(serialised);
|
||||
try {
|
||||
final String serialised = Component.Serializer.toJson(inComponent, getRegistryLookup());
|
||||
return adventureSerializer.deserialize(serialised);
|
||||
} catch (Exception e) {
|
||||
return net.kyori.adventure.text.Component.text(inComponent.getString());
|
||||
}
|
||||
}
|
||||
|
||||
private static HolderLookup.Provider getRegistryLookup() {
|
||||
|
13
changelog.md
13
changelog.md
@@ -1,13 +1,4 @@
|
||||
**Bug Fixes**:
|
||||
|
||||
- Fixed LuckPerms breaking commands on Paper
|
||||
- Fix Config watcher using too many threads and not detecting changes on Linux systems
|
||||
|
||||
**New Features**:
|
||||
|
||||
- Added Nojang API to allow mods to access GameRules (SDLink)
|
||||
- Exposed Adventure JSON serializer to mods
|
||||
|
||||
**Dev Changes**:
|
||||
|
||||
- Bumped MoonConfig - `1.0.10` -> `1.0.12`
|
||||
- Fix Adventure Serializer failing completely when serialization fails, causing game glitches
|
||||
-
|
@@ -1,8 +1,8 @@
|
||||
#Project
|
||||
version_major=2
|
||||
version_minor=1
|
||||
version_patch=4
|
||||
version_build=2
|
||||
version_patch=5
|
||||
version_build=0
|
||||
|
||||
#Mod
|
||||
mod_author=HypherionSA
|
||||
|
Reference in New Issue
Block a user