33import com .mojang .datafixers .util .Either ;
44import me .char321 .chunkcacher .WorldCache ;
55import net .minecraft .nbt .NbtCompound ;
6- import net .minecraft .server .world .ChunkHolder ;
7- import net .minecraft .server .world .ServerWorld ;
8- import net .minecraft .server .world .ThreadedAnvilChunkStorage ;
6+ import net .minecraft .server .world .*;
97import net .minecraft .util .math .ChunkPos ;
10- import net .minecraft .world .chunk .Chunk ;
11- import net .minecraft .world .chunk .ChunkStatus ;
12- import org .spongepowered .asm .mixin .Final ;
13- import org .spongepowered .asm .mixin .Mixin ;
14- import org .spongepowered .asm .mixin .Shadow ;
15- import org .spongepowered .asm .mixin .injection .At ;
16- import org .spongepowered .asm .mixin .injection .Inject ;
17- import org .spongepowered .asm .mixin .injection .ModifyVariable ;
8+ import net .minecraft .world .chunk .*;
9+ import org .spongepowered .asm .mixin .*;
10+ import org .spongepowered .asm .mixin .injection .*;
1811import org .spongepowered .asm .mixin .injection .callback .CallbackInfoReturnable ;
1912
2013import java .util .concurrent .CompletableFuture ;
2114
2215@ Mixin (ThreadedAnvilChunkStorage .class )
2316public class ThreadedAnvilChunkStorageMixin {
24-
25- @ Shadow @ Final ServerWorld world ;
17+ @ Shadow
18+ @ Final
19+ ServerWorld world ;
2620
2721 @ Inject (method = "method_17225" , at = @ At ("RETURN" ), remap = false )
2822 private void addToCache (CallbackInfoReturnable <CompletableFuture <Either <Chunk , ChunkHolder .Unloaded >>> cir ) {
@@ -35,9 +29,9 @@ private void addToCache(CallbackInfoReturnable<CompletableFuture<Either<Chunk, C
3529 }
3630 }
3731
38- /*
39- 1.19 changes the return type of getUpdatedChunkNbt to a CompletableFuture, so instead we
40- modify the nbtCompound a bit later in loadChunk to keep compatibility
32+ /**
33+ * 1.18 changes the return type of getUpdatedChunkNbt to a CompletableFuture, so instead we
34+ * modify the nbtCompound a bit later in loadChunk to keep compatibility
4135 */
4236 @ ModifyVariable (method = "method_17256" , at = @ At ("STORE" ), remap = false )
4337 private NbtCompound loadFromCache (NbtCompound nbtCompound , ChunkPos pos ) {
@@ -46,4 +40,4 @@ private NbtCompound loadFromCache(NbtCompound nbtCompound, ChunkPos pos) {
4640 }
4741 return nbtCompound ;
4842 }
49- }
43+ }
0 commit comments