Skip to content

Commit

Permalink
Fix 1.18.2 async chunk deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Aug 21, 2024
1 parent e73e58f commit 990e121
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.countercraft.movecraft.processing.WorldManager;
import net.countercraft.movecraft.support.AsyncChunk;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.chunk.ChunkAccess;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
Expand All @@ -26,8 +27,11 @@ public BlockState load(@NotNull MovecraftLocation movecraftLocation) {
}
});

private final ChunkAccess handle;

public IAsyncChunk(@NotNull Chunk chunk) {
super(chunk);
handle = this.chunk.getHandle();
}

@NotNull
Expand All @@ -51,7 +55,7 @@ public Material getType(@NotNull MovecraftLocation location){
@Override
@NotNull
public BlockData getData(@NotNull MovecraftLocation location){
return CraftBlockData.fromData(chunk.getHandle().getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())));
return CraftBlockData.fromData(handle.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())));
}

}

0 comments on commit 990e121

Please sign in to comment.