11package org .embeddedt .archaicfix .mixins .common .lighting ;
22
3- import net .minecraft .nbt .NBTTagCompound ;
43import net .minecraft .world .World ;
54import net .minecraft .world .chunk .Chunk ;
65import net .minecraft .world .chunk .storage .AnvilChunkLoader ;
7- import org .embeddedt .archaicfix .lighting .api .IChunkLightingData ;
86import org .embeddedt .archaicfix .lighting .api .ILightingEngineProvider ;
9- import org .embeddedt .archaicfix .lighting .world .lighting .LightingHooks ;
107import org .spongepowered .asm .mixin .Mixin ;
118import org .spongepowered .asm .mixin .injection .At ;
129import org .spongepowered .asm .mixin .injection .Inject ;
1310import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
14- import org .spongepowered .asm .mixin .injection .callback .CallbackInfoReturnable ;
1511
1612@ Mixin (AnvilChunkLoader .class )
1713public abstract class MixinAnvilChunkLoader {
@@ -24,30 +20,4 @@ public abstract class MixinAnvilChunkLoader {
2420 private void onConstructed (World world , Chunk chunkIn , CallbackInfo callbackInfo ) {
2521 ((ILightingEngineProvider ) world ).getLightingEngine ().processLightUpdates ();
2622 }
27-
28- /**
29- * Injects the deserialization logic for chunk data on load so we can extract whether or not we've populated light yet.
30- *
31- * @author Angeline
32- */
33- @ Inject (method = "readChunkFromNBT" , at = @ At ("RETURN" ))
34- private void onReadChunkFromNBT (World world , NBTTagCompound compound , CallbackInfoReturnable <Chunk > cir ) {
35- Chunk chunk = cir .getReturnValue ();
36-
37- LightingHooks .readNeighborLightChecksFromNBT (chunk , compound );
38-
39- ((IChunkLightingData ) chunk ).setLightInitialized (compound .getBoolean ("LightPopulated" ));
40-
41- }
42-
43- /**
44- * Injects the serialization logic for chunk data on save so we can store whether or not we've populated light yet.
45- * @author Angeline
46- */
47- @ Inject (method = "writeChunkToNBT" , at = @ At ("RETURN" ))
48- private void onWriteChunkToNBT (Chunk chunk , World world , NBTTagCompound compound , CallbackInfo ci ) {
49- LightingHooks .writeNeighborLightChecksToNBT (chunk , compound );
50-
51- compound .setBoolean ("LightPopulated" , ((IChunkLightingData ) chunk ).isLightInitialized ());
52- }
5323}
0 commit comments