Add back post_teleport chunk ticket

This commit is contained in:
Nassim Jahnke
2024-12-03 22:56:26 +01:00
parent 636439f610
commit df479182fe
3 changed files with 22 additions and 2 deletions

View File

@@ -89,6 +89,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ world.loadChunksForMoveAsync(getHandle().getBoundingBoxAt(locationClone.getX(), locationClone.getY(), locationClone.getZ()),
+ this instanceof CraftPlayer ? ca.spottedleaf.concurrentutil.util.Priority.HIGHER : ca.spottedleaf.concurrentutil.util.Priority.NORMAL, (list) -> {
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> {
+ final net.minecraft.server.level.ServerChunkCache chunkCache = world.getChunkSource();
+ for (final net.minecraft.world.level.chunk.ChunkAccess chunk : list) {
+ chunkCache.addTicketAtLevel(net.minecraft.server.level.TicketType.POST_TELEPORT, chunk.getPos(), 33, CraftEntity.this.getEntityId());
+ }
+ try {
+ ret.complete(CraftEntity.this.teleport(locationClone, cause, teleportFlags) ? Boolean.TRUE : Boolean.FALSE);
+ } catch (Throwable throwable) {