Update starlight + read null light data (#7912)

This commit is contained in:
Owen1212055 2022-06-09 19:49:23 -04:00
parent b953c4baa7
commit 797d43f5ef

View file

@ -5048,7 +5048,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static final String SKY_LIGHT_TAG = "SkyLight";
+ // Paper start - replace light engine impl
+ private static final int STARLIGHT_LIGHT_VERSION = 7;
+ private static final int STARLIGHT_LIGHT_VERSION = 8;
+
+ private static final String BLOCKLIGHT_STATE_TAG = "starlight.blocklight_state";
+ private static final String SKYLIGHT_STATE_TAG = "starlight.skylight_state";
@ -5131,6 +5131,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // is forced to re-light them if it encounters our data. It's too much of a burden
+ // to try and maintain compatibility with a broken and inferior skylight management system.
+ skyNibbles[y - minSection] = new ca.spottedleaf.starlight.common.light.SWMRNibbleArray(sectionData.getByteArray("SkyLight").clone(), sectionData.getInt(SKYLIGHT_STATE_TAG)); // clone for data safety
+ } else {
+ blockNibbles[y - minSection] = new ca.spottedleaf.starlight.common.light.SWMRNibbleArray(null, sectionData.getInt(BLOCKLIGHT_STATE_TAG));
}
+ // Paper end - rewrite light engine
}