Minenash / CustomHUD

A highly customizable variable-based text HUD for Minecraft
MIT License
82 stars 23 forks source link

nx and nz do not work properly in the nether. #49

Closed bakjedev closed 1 year ago

bakjedev commented 2 years ago

nx and nz just divide the coords again even in the nether. while its supposed to multipy

Minenash commented 2 years ago

I feel stupid on this one, cause here's the relevant code:

public static final Entry NETHER_X = of( () -> inNether() ? cameraEntity().getX() * 8 : cameraEntity().getX() / 8, 0);
public static final Entry NETHER_Z = of( () -> inNether() ? cameraEntity().getZ() * 8 : cameraEntity().getZ() / 8, 0);

aka, if in the nether, multiply by 8, else divide by 8. Here's the problem:

This is the code inNether() uses to check:

client.world.getRegistryKey().getValue().equals(World.NETHER)

Here's the correct code:

client.world.getRegistryKey().getValue().equals(World.NETHER.getValue())

Will fix now, release soon-ish after I fix a couple other bugs

Minenash commented 1 year ago

Fixed in v3.0!