[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) {
|
public static net.kyori.adventure.text.Component mojangToAdventure(Component inComponent) {
|
||||||
final String serialised = Component.Serializer.toJson(inComponent, getRegistryLookup());
|
try {
|
||||||
return adventureSerializer.deserialize(serialised);
|
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() {
|
private static HolderLookup.Provider getRegistryLookup() {
|
||||||
|
13
changelog.md
13
changelog.md
@@ -1,13 +1,4 @@
|
|||||||
**Bug Fixes**:
|
**Bug Fixes**:
|
||||||
|
|
||||||
- Fixed LuckPerms breaking commands on Paper
|
- Fix Adventure Serializer failing completely when serialization fails, causing game glitches
|
||||||
- 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`
|
|
@@ -1,8 +1,8 @@
|
|||||||
#Project
|
#Project
|
||||||
version_major=2
|
version_major=2
|
||||||
version_minor=1
|
version_minor=1
|
||||||
version_patch=4
|
version_patch=5
|
||||||
version_build=2
|
version_build=0
|
||||||
|
|
||||||
#Mod
|
#Mod
|
||||||
mod_author=HypherionSA
|
mod_author=HypherionSA
|
||||||
|
Reference in New Issue
Block a user