The code is getting confusing using Vector2, int that means different things:
Sometimes it's a world coordinate (3d coordinate)
Sometimes it's a chunk coordinate (x,y)
Sometimes it's a tile coordinate, within a chunk.
The origin is different, chunk goes from 0 to 63, but 32 is the center.
World coordinate is 0 for the center.
Simplify this by creating a UniversalCoordinate object (name TBD) that expose multiple properties with internal conversion.
Change all methods to use UniversalCoordinate (whenever it makes sense).
The code is getting confusing using Vector2, int that means different things:
The origin is different, chunk goes from 0 to 63, but 32 is the center. World coordinate is 0 for the center.
Simplify this by creating a UniversalCoordinate object (name TBD) that expose multiple properties with internal conversion. Change all methods to use UniversalCoordinate (whenever it makes sense).