Botania (Fabric/Quilt)

Botania (Fabric/Quilt)

6M Downloads

Corporea Crystal Cube Incorrectly Displays Block Counts Greater than One Million

pcrain opened this issue ยท 0 comments

commented

Mod Loader

Fabric

Minecraft Version

1.18.2

Botania version

1.18.2-435

Modloader version

Fabric: Loader 0.14.18 + API 0.58.0

Modpack info

No response

The latest.log file

N/A

Issue description

Very niche bug, but there's an issue in the render() method of CorporeaCrystalCubeBlockEntityRenderer that is incorrectly counting and displaying block sizes greater than one million: vazkii-bug-counting

This is the offending bit of code in CorporeaCrystalCubeBlockEntityRenderer.java. It's checking against 10 million rather than 1 million.

		if (!stack.isEmpty()) {
			int count = cube.getItemCount();
			String countStr = "" + count;
			int color = 0xFFFFFF;
			if (count > 9999) {
				countStr = count / 1000 + "K";
				color = 0xFFFF00;
				if (count > 9999999) { // possibly an extra 9 here unless "1234K" is preferred over "1M"
					countStr = count / 10000000 + "M"; // definitely an extra 0 here, should be 1000000
					color = 0x00FF00;
				}
			}

Steps to reproduce

  • Link Corporea Sparks up to inventories whose sum of blocks is between one and ten million
    • Numbers are rendered as XXXXK (e.g., 1,234,567 items become "1234K" rather than "1M")
    • Not sure this one's actually a bug since normal items count up to 10,000 before switching to the "K" format
  • Link Corporea Sparks up to inventories whose sum of blocks is over ten million
    • Numbers are off by a factor of 10 (e.g., 12,345,678 items becomes "1M" rather than "12M")

Other information

Great mod btw, probably have hundreds of hours sunk into it Botania this point. ๐Ÿ˜„