PaperMC/paper-server/patches/sources/net/minecraft/world/level/LevelReader.java.patch

13 lines
602 B
Diff
Raw Normal View History

--- a/net/minecraft/world/level/LevelReader.java
+++ b/net/minecraft/world/level/LevelReader.java
2024-12-15 00:42:27 +01:00
@@ -26,6 +_,9 @@
@Nullable
2024-12-15 00:42:27 +01:00
ChunkAccess getChunk(int x, int z, ChunkStatus chunkStatus, boolean requireChunk);
+ @Nullable ChunkAccess getChunkIfLoadedImmediately(int x, int z); // Paper - ifLoaded api (we need this since current impl blocks if the chunk is loading)
+ @Nullable default ChunkAccess getChunkIfLoadedImmediately(BlockPos pos) { return this.getChunkIfLoadedImmediately(pos.getX() >> 4, pos.getZ() >> 4);}
+
@Deprecated
boolean hasChunk(int chunkX, int chunkZ);