johnvictorfs / simple-utilities-mod

A minecraft mod with some simple client-side interface utilities
https://modrinth.com/mod/simple-hud-utilities
MIT License
27 stars 21 forks source link

Mod is giving wrong coordinates. #67

Open husnain-majeed opened 2 years ago

husnain-majeed commented 2 years ago

I have noticed that on the Z axis the mod says that two blocks are both at a position of Z : 0. This makes all the Z cords wrong as it offsets everything by 1.

using minecraft 1.19.2 & mod ver 2.5.2 , have other mods.

image

image (cords for both blocks)

SoRadGaming commented 1 year ago

First, the top left shows the player's current position, not blocks. Second, in the below image, both the green blocks have the same Z-axis value, so I'm trying to figure out what the problem is you are describing. image

husnain-majeed commented 1 year ago

I know the top left shows my position and not the blocks in the screenshot, however, the problem I am stating happens when I am on both blocks show, the screenshot is just so you can visualize the problem.

You misunderstand the blocks are not on the same Z Axis as I am looking West therefore when I move left or right I am moving on the Z axis so the Z increments by 1 per block (as it does on your mod and in-game coordinates) except when you get to 0 they in your mod there are two blocks with the coordinate Z of 0, this means all coordinates after 0 are wrong by - 1.

Both those dirt blocks are Z : 0 in your mod when moving left to right while the left should be 0 and the right should be -1

Hope this clears things up, if not ill try to take some screenshots

SoRadGaming commented 1 year ago

Yeah just tested it; it's offset by one in X, Y and Z axes. It's because the code only grabs the first value of the axis. Simple to fix; thanks for the clarification.

husnain-majeed commented 1 year ago

Happy to help !