chunky-dev / chunky

A path tracer to create realistic images of your Minecraft worlds.
https://chunky-dev.github.io/docs
GNU General Public License v3.0
647 stars 76 forks source link

Add RegionPosition class, replace all usages of ChunkPosition as a region with it. #1622

Closed NotStirred closed 3 weeks ago

NotStirred commented 1 year ago

This should have zero impact on performance, but makes things much clearer and adds a nice layer of type safety on top.

I think the name of ChunkPosition#asRegionPosition is worth discussing. I didn't want to change the return type of the existing getRegionPosition in case any plugins use it as I'm unsure. Maybe none do?

NotStirred commented 3 weeks ago

Rebased onto master (auto rebase was failing horribly)