Closed James103 closed 2 years ago
Pretty sure I even saw this issue while fixing #15 and just paid no mind to it, this seems like an easy fix that I should be able to get done once I'm back at home later
The number format breaking for negative numbers is because the format function does not check that the number is negative before formatting the number.
Fixed in [1.16] 1.0.12
Backported to 1.15 in [1.15] 1.0.11
As of mod version 1.0.11 for Minecraft 1.16.5, losing EMC over time shows two minus signs in front of the number, like below:
To reproduce:
To reproduce with larger numbers, which cause the number to not be shortened when required:
emc set @s 1000000000000
emc set @s 100000000000
This may be caused by the following line of code prepending a negative sign to a negative number that formats to a string generated by the
EMCFormat.INSTANCE.format
function which already contains a leading negative sign: https://github.com/DonovanDMC/ProjectExpansion/blob/3ad2f6fad66b1002531228cb28c8ce05d584d81c/src/main/java/cool/furry/mc/forge/projectexpansion/gui/EMCDisplay.java#L67