Fix MC-297591

Vanilla does not increment ticket timeouts if the chunk is
progressing in generation. They made this change in 1.21.6
so that the ender pearl ticket does not expire if the chunk
fails to generate before the timeout expires. Rather than
blindly adjusting the entire system behavior to fix this
small issue, we instead add non-expirable tickets to keep
ender pearls ticking.
This commit is contained in:
Spottedleaf
2025-06-20 20:51:44 -07:00
parent 839c6a1845
commit c77d5f99f9
4 changed files with 67 additions and 9 deletions

View File

@@ -102,6 +102,8 @@ public interface PlatformHooks extends ChunkSystemHooks {
public int modifyEntityTrackingRange(final Entity entity, final int currentRange);
public boolean addTicketForEnderPearls(final ServerLevel world);
public static final class Holder {
private Holder() {
}

View File

@@ -16,7 +16,8 @@ public final class CoordinateUtils {
}
public static long getChunkKey(final Entity entity) {
return ((Mth.lfloor(entity.getZ()) >> 4) << 32) | ((Mth.lfloor(entity.getX()) >> 4) & 0xFFFFFFFFL);
final ChunkPos pos = entity.chunkPosition();
return ((long)pos.z << 32) | (pos.x & 0xFFFFFFFFL);
}
public static long getChunkKey(final ChunkPos pos) {