@@ -4108,10 +4108,10 @@ index 0000000000000000000000000000000000000000..177d0a969f3d72a34e773e8309c3719a
4108
4108
+ }
4109
4109
diff --git a/src/main/java/ca/spottedleaf/starlight/common/util/SaveUtil.java b/src/main/java/ca/spottedleaf/starlight/common/util/SaveUtil.java
4110
4110
new file mode 100644
4111
- index 0000000000000000000000000000000000000000..9892863af9f94ab8e378652df2a7ccfebb8c7f41
4111
+ index 0000000000000000000000000000000000000000..6df9e01731d7fcbe279736b8fc18396595b95574
4112
4112
--- /dev/null
4113
4113
+++ b/src/main/java/ca/spottedleaf/starlight/common/util/SaveUtil.java
4114
- @@ -0,0 +1,187 @@
4114
+ @@ -0,0 +1,192 @@
4115
4115
+ package ca.spottedleaf.starlight.common.util;
4116
4116
+
4117
4117
+ import ca.spottedleaf.starlight.common.light.SWMRNibbleArray;
@@ -4143,9 +4143,12 @@ index 0000000000000000000000000000000000000000..9892863af9f94ab8e378652df2a7ccfe
4143
4143
+ public static void saveLightHook(final Level world, final ChunkAccess chunk, final CompoundTag nbt) {
4144
4144
+ try {
4145
4145
+ saveLightHookReal(world, chunk, nbt);
4146
- + } catch (final Exception ex) {
4146
+ + } catch (final Throwable ex) {
4147
4147
+ // failing to inject is not fatal so we catch anything here. if it fails, it will have correctly set lit to false
4148
4148
+ // 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
+ + }
4149
4152
+ LOGGER.warn("Failed to inject light data into save data for chunk " + chunk.getPos() + ", chunk light will be recalculated on its next load", ex);
4150
4153
+ }
4151
4154
+ }
@@ -4237,9 +4240,12 @@ index 0000000000000000000000000000000000000000..9892863af9f94ab8e378652df2a7ccfe
4237
4240
+ public static void loadLightHook(final Level world, final ChunkPos pos, final CompoundTag tag, final ChunkAccess into) {
4238
4241
+ try {
4239
4242
+ loadLightHookReal(world, pos, tag, into);
4240
- + } catch (final Exception ex) {
4243
+ + } catch (final Throwable ex) {
4241
4244
+ // failing to inject is not fatal so we catch anything here. if it fails, then we simply relight. Not a problem, we get correct
4242
4245
+ // lighting in both cases.
4246
+ + if (ex instanceof ThreadDeath) {
4247
+ + throw (ThreadDeath)ex;
4248
+ + }
4243
4249
+ LOGGER.warn("Failed to load light for chunk " + pos + ", light will be recalculated", ex);
4244
4250
+ }
4245
4251
+ }
@@ -4297,7 +4303,6 @@ index 0000000000000000000000000000000000000000..9892863af9f94ab8e378652df2a7ccfe
4297
4303
+ }
4298
4304
+
4299
4305
+ private SaveUtil() {}
4300
- +
4301
4306
+ }
4302
4307
diff --git a/src/main/java/ca/spottedleaf/starlight/common/util/WorldUtil.java b/src/main/java/ca/spottedleaf/starlight/common/util/WorldUtil.java
4303
4308
new file mode 100644
0 commit comments