Skip to content

Commit

Permalink
Fix incorrect divisor in Crystal Cube renderer for over 10M items (Va…
Browse files Browse the repository at this point in the history
…zkiiMods#4328)

Fix for VazkiiMods#4322, assuming the switch from K to M suffix is intentionally
at 10M items, since the switch from no suffix to K also happens at one
digit more.
  • Loading branch information
TheRealWormbo authored Apr 14, 2023
1 parent d029a04 commit 02b3300
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ Making the divider smaller, slows down the cube bobbing (you can multiply instea
ms.popPose();
}

if (!stack.isEmpty()) {
if (!stack.isEmpty() && cube != null) {
int count = cube.getItemCount();
String countStr = "" + count;
String countStr = String.valueOf(count);
int color = 0xFFFFFF;
if (count > 9999) {
countStr = count / 1000 + "K";
if (count > 9_999) {
countStr = count / 1_000 + "K";
color = 0xFFFF00;
if (count > 9999999) {
countStr = count / 10000000 + "M";
if (count > 9_999_999) {
countStr = count / 1_000_000 + "M";
color = 0x00FF00;
}
}
Expand Down

0 comments on commit 02b3300

Please sign in to comment.