Two related issues with HUD compass
QBFreak opened this issue ยท 3 comments
Bug Report
The Direction
component of the compass in the HUD (available when a Minecraft compass is in your inventory) gets stuck on S
if you rotate the player counterclockwise (left) too many times. This can be undone by rotating clockwise (right) as many times as you rotated counterclockwise.
Related, the bearing portion of the Direction
(value in parenthesis) remains negative even after a full revolution. This may be expected behavior. I'm not 100% sure what this is trying to convey so I can't say for sure. Multiple revolutions into the negative require multiple revolutions to the positive (and vice versa). I'm less sure that's expected behavior, and my suspicion is that is related to the previous portion of the issue as the Direction
is only incorrect when the bearing is negative.
Expected Behaviour
The Direction
component of the HUD compass should always display the correct cardinal direction (NESW, plus the diagonals). It should not matter how many times a player has rotated in any one direction. Otherwise spiral stairs would be a real problem ๐
If the bearing is supposed to reflect the player's rotation from North, than this should reset to positive zero upon reaching North, regardless of rotation.
If the bearing is supposed to reflect an internal value typically found on the F3 screen (or is working properly regardless) then please disregard this portion of the bug report.
Steps to Reproduce (for bugs)
- Reach the
Get Lost, Oh Wait...
Advancement in Age 2, either by natural play or cheating items in - Rotate the player multiple times counterclockwise (to the left) and observe that the compass
Direction
in the HUD is stuck on south, regardless of which direction the player is facing - Rotate the player a greater number of times clockwise (to the right) and observe that once an equal number of rotations have been made, the
Direction
starts functioning normally again - Rotate the player a greater number of times counterclockwise (to the left) again and observe that once the player has rotate more times CCW than CW, the
Direction
becomes stuck on South again.
- This occurs regardless of playing client-only or client-server.
- This occurs both in the normal survival non-cheating game I'm playing, as well as the creative test world (default SevTech world parameters) I made to verify it was easy to reproduce.
- I have not installed any other mods
- This occurs in a freshly installed, unmodified SevTech: Ages install
Logs
- Client/Server Log:
https://qbfreak.net/sevtech-compass-bug-log.txt (2.4MB, too large for pastebin.com)
This is the client (only) log for the test world. If you wish a client or server log for my normal play world as well let me know. I've made a couple minor tweaks to config files and one recipe change, so I've tried to ensure everything I've referenced applies to the unmodified test world.
Client Information
- Modpack Version: 3.1.1
- Java Version: 1.8.0_212-8u212-b03-0ubuntu1.16.04.1-b03
- Launcher Used: MultiMC
- Memory Allocated:
- 4096 MB for test install
- 5120 MB for normal play, client
- 4096 MB for normal play, server (separate machine)
- Server/LAN/Single Player: Test install SP, normal play LAN server
- Optifine Installed: No
- Shaders Enabled: No
World Information
- Modpack Version world created in: 3.1.1 (both test world and normal play)
- Additional Content Installed: No additional mods, client or server
Server Information
- Java Version: 1.8.0_181-8u181-b13-1ubuntu0.18.04.1-b13
- Operating System: Linux Mint 19 Tara
- Hoster/Hosting Solution: LAN / Self
- Sponge (Non-Vanilla Forge) Server: N/A (Vanilla Forge)
Please let me know if there's any other information you need, or anything else I can do to help troubleshoot. I was unable to determine which mod provided this functionality or I would have first checked there for bug reporting. Near as I can tell there are no similar open or closed issues for SevTech.
I found the same issue reported in the repository for Informational Accessories, so I'll just repost what I said there:
Since this mod is over five years old and the owner has likely abandoned it in favor of newer versions of the game, I made a fork that fixes the issue.
In net.darkhax.infoaccessories.info.InfoType
, at line 102, I replaced
final int yaw = MathHelper.floor(player.rotationYaw % 360.0F);
with
final int yaw = (player.rotationYaw < 0) ? MathHelper.floor(360 + (player.rotationYaw % 360.0F)) : MathHelper.floor(player.rotationYaw % 360.0F);
The main issue here was that the modulo operator works differently for negative numbers.
I also had trouble compiling the jar, so I used cursemaven to resolve dependencies.
Anyway, here's the fork. I tested this version to be compatible with Sevtech Ages 3.2.3 (the latest version as of 31 October 2023), so if you just replace the old jar with the one I included in my fork, you should be good to go. Enjoy!
I've added a fix for this in the latest version of SevPatches (v1.13.0) which you can download here: https://github.com/DarkPacks/SevPatches/releases/tag/1.13.0
I apologize, at the time I opened this I was unaware of which mod provided this feature (I only had the compass and totally spaced on looking at any of the other items in JEI). I've submitted a bug report to Informational Accessories. It can be found here.