Skip to content

Commit 9797f08

Browse files
committed
Sync Starlight SaveUtil with 1.1.1
Code isn't used, but still should be synced
1 parent b0eb4e0 commit 9797f08

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

patches/server/0791-Rewrite-the-light-engine.patch

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4108,10 +4108,10 @@ index 0000000000000000000000000000000000000000..177d0a969f3d72a34e773e8309c3719a
41084108
+}
41094109
diff --git a/src/main/java/ca/spottedleaf/starlight/common/util/SaveUtil.java b/src/main/java/ca/spottedleaf/starlight/common/util/SaveUtil.java
41104110
new file mode 100644
4111-
index 0000000000000000000000000000000000000000..9892863af9f94ab8e378652df2a7ccfebb8c7f41
4111+
index 0000000000000000000000000000000000000000..6df9e01731d7fcbe279736b8fc18396595b95574
41124112
--- /dev/null
41134113
+++ b/src/main/java/ca/spottedleaf/starlight/common/util/SaveUtil.java
4114-
@@ -0,0 +1,187 @@
4114+
@@ -0,0 +1,192 @@
41154115
+package ca.spottedleaf.starlight.common.util;
41164116
+
41174117
+import ca.spottedleaf.starlight.common.light.SWMRNibbleArray;
@@ -4143,9 +4143,12 @@ index 0000000000000000000000000000000000000000..9892863af9f94ab8e378652df2a7ccfe
41434143
+ public static void saveLightHook(final Level world, final ChunkAccess chunk, final CompoundTag nbt) {
41444144
+ try {
41454145
+ saveLightHookReal(world, chunk, nbt);
4146-
+ } catch (final Exception ex) {
4146+
+ } catch (final Throwable ex) {
41474147
+ // failing to inject is not fatal so we catch anything here. if it fails, it will have correctly set lit to false
41484148
+ // for Vanilla to relight on load and it will not set our lit tag so we will relight on load
4149+
+ if (ex instanceof ThreadDeath) {
4150+
+ throw (ThreadDeath)ex;
4151+
+ }
41494152
+ LOGGER.warn("Failed to inject light data into save data for chunk " + chunk.getPos() + ", chunk light will be recalculated on its next load", ex);
41504153
+ }
41514154
+ }
@@ -4237,9 +4240,12 @@ index 0000000000000000000000000000000000000000..9892863af9f94ab8e378652df2a7ccfe
42374240
+ public static void loadLightHook(final Level world, final ChunkPos pos, final CompoundTag tag, final ChunkAccess into) {
42384241
+ try {
42394242
+ loadLightHookReal(world, pos, tag, into);
4240-
+ } catch (final Exception ex) {
4243+
+ } catch (final Throwable ex) {
42414244
+ // failing to inject is not fatal so we catch anything here. if it fails, then we simply relight. Not a problem, we get correct
42424245
+ // lighting in both cases.
4246+
+ if (ex instanceof ThreadDeath) {
4247+
+ throw (ThreadDeath)ex;
4248+
+ }
42434249
+ LOGGER.warn("Failed to load light for chunk " + pos + ", light will be recalculated", ex);
42444250
+ }
42454251
+ }
@@ -4297,7 +4303,6 @@ index 0000000000000000000000000000000000000000..9892863af9f94ab8e378652df2a7ccfe
42974303
+ }
42984304
+
42994305
+ private SaveUtil() {}
4300-
+
43014306
+}
43024307
diff --git a/src/main/java/ca/spottedleaf/starlight/common/util/WorldUtil.java b/src/main/java/ca/spottedleaf/starlight/common/util/WorldUtil.java
43034308
new file mode 100644

0 commit comments

Comments
 (0)