Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
notTamion committed Apr 22, 2024
1 parent 867b15e commit 862c67c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions patches/server/0005-Paper-config-files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2447,10 +2447,10 @@ index 0000000000000000000000000000000000000000..9c339ef178ebc3b0251095f320e4a7a3
+}
diff --git a/src/main/java/io/papermc/paper/configuration/serializer/DespawnRangeSerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/DespawnRangeSerializer.java
new file mode 100644
index 0000000000000000000000000000000000000000..31d3032a1c1fce889fb3aa66e4c8394d169db2e0
index 0000000000000000000000000000000000000000..6d20301d9f394e8068e95f960d698c7ec0cbd22e
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/serializer/DespawnRangeSerializer.java
@@ -0,0 +1,83 @@
@@ -0,0 +1,77 @@
+package io.papermc.paper.configuration.serializer;
+
+import io.papermc.paper.configuration.WorldConfiguration.Entities.Spawning.DespawnRange;
Expand All @@ -2463,11 +2463,6 @@ index 0000000000000000000000000000000000000000..31d3032a1c1fce889fb3aa66e4c8394d
+
+public class DespawnRangeSerializer implements TypeSerializer<DespawnRange> {
+
+ private Type type;
+
+ public DespawnRangeSerializer() {
+ }
+
+ @Override
+ public DespawnRange deserialize(final Type type, final ConfigurationNode node) throws SerializationException {
+ ConfigurationNode hard = node.node("hard");
Expand All @@ -2479,7 +2474,6 @@ index 0000000000000000000000000000000000000000..31d3032a1c1fce889fb3aa66e4c8394d
+ int ySoftLimit;
+
+ MobCategory category = MobCategory.valueOf(node.key().toString().toUpperCase());
+ this.type = type;
+
+ if (hard.hasChild("horizontal") || hard.hasChild("vertical")) {
+ xzLimit = ifPresent(hard.node("horizontal"), category.getDespawnDistance());
Expand Down Expand Up @@ -2531,7 +2525,7 @@ index 0000000000000000000000000000000000000000..31d3032a1c1fce889fb3aa66e4c8394d
+ return or;
+ if (node.raw() instanceof Integer i)
+ return i;
+ throw new RuntimeException(new SerializationException(node, type, "Expected an integer, got \"" + node.raw() + "\" instead"));
+ throw new RuntimeException(new SerializationException(node, Integer.class, "Expected an integer, got \"" + node.raw() + "\" instead"));
+ }
+}
diff --git a/src/main/java/io/papermc/paper/configuration/serializer/EngineModeSerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/EngineModeSerializer.java
Expand Down

0 comments on commit 862c67c

Please sign in to comment.