Botania

Botania

133M Downloads

Corporea Crystal Cube Incorrectly Displays Block Counts Greater than One Million

pcrain opened this issue ยท 1 comments

commented

Mod Loader

Fabric

Minecraft Version

1.18.2

Botania version

1.18.2-435

Modloader version

Fabric: Loader 0.14.18 +

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) { // extra 9 here, should be 999999
					countStr = count / 10000000 + "M"; // extra 0 here, should be 10000000
					color = 0x00FF00;
				}
			}

Steps to reproduce

  • Link Corporea Sparks up to inventories whose sum of blocks between one and ten million
    • Numbers are rendered as XXXXK (e.g., 1,234,567 items become "1234K" rather than "1M")
  • 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. ๐Ÿ˜„

commented

Not sure how this got duplicated, sorry. D: