13
0
geforkt von Mirrors/Paper

Sync Starlight SaveUtil with 1.1.1

Code isn't used, but still should be synced
Dieser Commit ist enthalten in:
Spottedleaf 2022-06-18 14:48:08 -07:00
Ursprung c517b28adc
Commit 4c6e227360

Datei anzeigen

@ -4143,9 +4143,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public static void saveLightHook(final Level world, final ChunkAccess chunk, final CompoundTag nbt) {
+ try {
+ saveLightHookReal(world, chunk, nbt);
+ } catch (final Exception ex) {
+ } catch (final Throwable ex) {
+ // failing to inject is not fatal so we catch anything here. if it fails, it will have correctly set lit to false
+ // for Vanilla to relight on load and it will not set our lit tag so we will relight on load
+ if (ex instanceof ThreadDeath) {
+ throw (ThreadDeath)ex;
+ }
+ LOGGER.warn("Failed to inject light data into save data for chunk " + chunk.getPos() + ", chunk light will be recalculated on its next load", ex);
+ }
+ }
@ -4237,9 +4240,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public static void loadLightHook(final Level world, final ChunkPos pos, final CompoundTag tag, final ChunkAccess into) {
+ try {
+ loadLightHookReal(world, pos, tag, into);
+ } catch (final Exception ex) {
+ } catch (final Throwable ex) {
+ // failing to inject is not fatal so we catch anything here. if it fails, then we simply relight. Not a problem, we get correct
+ // lighting in both cases.
+ if (ex instanceof ThreadDeath) {
+ throw (ThreadDeath)ex;
+ }
+ LOGGER.warn("Failed to load light for chunk " + pos + ", light will be recalculated", ex);
+ }
+ }
@ -4297,7 +4303,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ private SaveUtil() {}
+
+}
diff --git a/src/main/java/ca/spottedleaf/starlight/common/util/WorldUtil.java b/src/main/java/ca/spottedleaf/starlight/common/util/WorldUtil.java
new file mode 100644