9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-27 19:09:22 +00:00
Files
Leaf/patches/server/0061-Don-t-throw-exception-on-missing-ResourceKey-value.patch
Dreeam 4a06d00973 Refactor: Leaf Config v3 (#81)
* 1

* 2

* 3

* 4

* 5

* 6

* 7

* Change contact info in config

* Add contact info for QQ group

* Add more detailed explanation for configurable connection message config

* Fix comments grammar issues

* Purge old or outdated config on load config

* Clean up
2024-07-12 01:34:15 +08:00

28 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Mon, 26 Feb 2024 18:51:02 -0500
Subject: [PATCH] Don't throw exception on missing ResourceKey value
diff --git a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java
index 718377ce91a010a48b2b4a5e59e02ee8a42107a7..2d085f819902d09d26c98e8606ca7ba69ffdcf3c 100644
--- a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java
+++ b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java
@@ -20,10 +20,14 @@ public final class RegistryValueSerializer<T> extends RegistryEntrySerializer<T,
}
@Override
- protected T convertFromResourceKey(ResourceKey<T> key) throws SerializationException {
+ protected T convertFromResourceKey(ResourceKey<T> key) {
final T value = this.registry().get(key);
if (value == null) {
- throw new SerializationException("Missing value in " + this.registry() + " with key " + key.location());
+ // Leaf start - Don't throw exception on missing ResourceKey value
+ //throw new SerializationException("Missing value in " + this.registry() + " with key " + key.location());
+ com.mojang.logging.LogUtils.getClassLogger().error("Missing value in {} with key {}", this.registry(), key.location());
+ return null;
+ // Leaf end - Don't throw exception on missing ResourceKey value
}
return value;
}