Last active
March 14, 2024 08:22
-
-
Save DarkblooM-IO/536183c09a1b2ee8ef15bc33a83d986d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from argparse import ArgumentParser | |
parser = ArgumentParser(prog="NetherCoords", description="Converts Nether coordinates to Overworld coordinates") | |
parser.add_argument('x', type=int, metavar="X", help="X position") | |
parser.add_argument('z', type=int, metavar="Z", help="Z position") | |
parser.add_argument('-o', '--overworld', action='store_true', help="Use Overworld coordinates and convert them to Nether coordinates instead") | |
def main() -> None: | |
args = parser.parse_args() | |
x: int = round(args.x / 8) if not args.overworld else round(args.x * 8) | |
z: int = round(args.z / 8) if not args.overworld else round(args.z * 8) | |
print(f"X: {x}\nZ: {z}") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment