Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature suggestion], add "Copy region coordinates" to right click map menu #211

Closed
Delvin4519 opened this issue Feb 18, 2023 · 2 comments
Closed

Comments

@Delvin4519
Copy link

I was going to file this prior to release, however, github was down that night and therefore wasn't able to do so.

This is an extremely minor quality of life feature. To my understanding, it's only 2 simple lines to add.

As the title says, when right clicking the map, the right click menu should show an extra option to copy the region file coordinates. Minecraft stores chunks in region files of 512x512 wide. This makes it easy to locate what region file a block or chunk is located in.

For example, block coordinates -2127, -5263 is located in region file -5, -11, in file r.-5.-11.mca, therefore, the right click menu shows this is such that can have the option to copy the region file coordinates "Copy region -5 -11".

The region file coordinates is simply FLOOR(coordinates / 512), which is divide the coordinates by 512, and round down to the lower integer. Alternatively, it's 2 to the power of 9.

Perhaps mapview.cpp can be updated with an extra 2 lines at line 335 and 341?

ln336: QString region = QString::asprintf("%d %d", p.x >> 9, p.z >> 9);
ln343 menu.addAction(tr("Copy region: ")+region, [=](){ this->copyText(region); });

image

Block 210, -320 is in region file 0, -1.
Block 2050, 1700 is in region file 4, 3.
Block -38574, 23985 is in region file -76, 46.

@Delvin4519 Delvin4519 changed the title [Feature suggestion], add "Copy region" to right click map menu [Feature suggestion], add "Copy region coordinates" to right click map menu Feb 18, 2023
@Cubitect
Copy link
Owner

Added in v3.2.1. -- I was just creating a patch anyway, since the noise views no longer worked.

@Delvin4519
Copy link
Author

ah, anyhow, looks fine, marking this as closed and resolved.

SunnySlopes pushed a commit to SunnySlopes/cubiomes-viewer that referenced this issue Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants