Update last chunk position in findSupportingBlock

Fixes fetching chunks needlessly multiple times.

Thanks Lulu13022002 for pointing this out
This commit is contained in:
Spottedleaf
2024-07-13 11:35:54 -07:00
parent 2eb4a71a35
commit 24657f1fd6
2 changed files with 3 additions and 1 deletions

View File

@@ -391,6 +391,8 @@ public abstract class LevelMixin implements CollisionLevel, LevelAccessor, AutoC
final int newChunkZ = currZ >> 4;
if (((newChunkX ^ lastChunkX) | (newChunkZ ^ lastChunkZ)) != 0) {
lastChunkX = newChunkX;
lastChunkZ = newChunkZ;
lastChunk = (LevelChunk)chunkSource.getChunk(newChunkX, newChunkZ, ChunkStatus.FULL, false);
}

View File

@@ -17,7 +17,7 @@ import org.spongepowered.asm.mixin.Overwrite;
public abstract class FarmBlockMixin {
/**
* @reason Avoid usage of betweenClsed, this can become very hot when
* @reason Avoid usage of betweenClosed, this can become very hot when
* there are significant numbers of farm blocks in the world
* @author Spottedleaf
*/