|
13 | 13 | import com.ishland.c2me.rewrites.chunksystem.common.fapi.LifecycleEventInvoker; |
14 | 14 | import com.ishland.c2me.rewrites.chunksystem.common.threadstate.ChunkTaskWork; |
15 | 15 | import com.ishland.flowsched.scheduler.Cancellable; |
| 16 | +import net.minecraft.class_11352; |
| 17 | +import net.minecraft.class_11368; |
16 | 18 | import net.minecraft.entity.EntityType; |
17 | 19 | import net.minecraft.entity.SpawnReason; |
18 | | -import net.minecraft.nbt.NbtCompound; |
19 | 20 | import net.minecraft.server.world.ServerWorld; |
| 21 | +import net.minecraft.util.ErrorReporter; |
20 | 22 | import net.minecraft.world.chunk.Chunk; |
21 | 23 | import net.minecraft.world.chunk.ChunkStatus; |
22 | 24 | import net.minecraft.world.chunk.ProtoChunk; |
23 | 25 | import net.minecraft.world.chunk.WorldChunk; |
24 | 26 | import net.minecraft.world.chunk.WrapperProtoChunk; |
| 27 | +import org.slf4j.Logger; |
| 28 | +import org.slf4j.LoggerFactory; |
25 | 29 |
|
26 | | -import java.util.List; |
27 | 30 | import java.util.concurrent.CompletableFuture; |
28 | 31 | import java.util.concurrent.CompletionStage; |
29 | 32 |
|
30 | 33 | public class ServerAccessible extends NewChunkStatus { |
31 | 34 |
|
| 35 | + private static final Logger LOGGER = LoggerFactory.getLogger(ServerAccessible.class); |
| 36 | + |
32 | 37 | public ServerAccessible(int ordinal) { |
33 | 38 | super(ordinal, ChunkStatus.FULL); |
34 | 39 | } |
@@ -70,9 +75,11 @@ private static WorldChunk toFullChunk(ProtoChunk protoChunk, ServerWorld serverW |
70 | 75 | worldChunk = ((WrapperProtoChunk) protoChunk).getWrappedChunk(); |
71 | 76 | } else { |
72 | 77 | worldChunk = new WorldChunk(serverWorld, protoChunk, worldChunkx -> { |
73 | | - final List<NbtCompound> entities = protoChunk.getEntities(); |
74 | | - if (!entities.isEmpty()) { |
75 | | - serverWorld.addEntities(EntityType.streamFromNbt(entities, serverWorld, SpawnReason.LOAD)); |
| 78 | + try (ErrorReporter.class_11340 lv = new ErrorReporter.class_11340(protoChunk.method_71412(), LOGGER)) { |
| 79 | + class_11368.class_11370 arg = class_11352.method_71416(lv, serverWorld.getRegistryManager(), protoChunk.getEntities()); |
| 80 | + if (!arg.method_71444()) { |
| 81 | + serverWorld.addEntities(EntityType.streamFromNbt(arg, serverWorld, SpawnReason.LOAD)); |
| 82 | + } |
76 | 83 | } |
77 | 84 | }); |
78 | 85 | } |
|
0 commit comments