Skip to content

Commit

Permalink
simplify local capture mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Feb 5, 2024
1 parent e146e24 commit c3b5890
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import org.waste.of.time.Events;

import java.util.function.Consumer;
Expand Down Expand Up @@ -40,10 +39,12 @@ private void onChunkUnload(ChunkPos pos, CallbackInfo ci, @Local final WorldChun
at = @At(
value = "INVOKE",
target = "net/minecraft/client/world/ClientChunkManager$ClientChunkMap.isInRadius(II)Z"
),
locals = LocalCapture.CAPTURE_FAILHARD
)
)
private void onUpdateLoadDistance(int loadDistance, CallbackInfo ci, int oldRadius, int newRadius, ClientChunkManager.ClientChunkMap clientChunkMap, int k, WorldChunk oldChunk, ChunkPos chunkPos) {
private void onUpdateLoadDistance(int loadDistance, CallbackInfo ci,
@Local ClientChunkManager.ClientChunkMap clientChunkMap,
@Local WorldChunk oldChunk,
@Local ChunkPos chunkPos) {
if (!clientChunkMap.isInRadius(chunkPos.x, chunkPos.z)) {
Events.INSTANCE.onChunkUnload(oldChunk);
}
Expand Down

0 comments on commit c3b5890

Please sign in to comment.