Reactive Alchemy

Reactive Alchemy

524k Downloads

Cauldron percentage is "floored"

slava110 opened this issue · 3 comments

commented

Because you're dividing int by int, you're ignoring fractional part of percentage.

return pow > 16 ? pow / 16 + "%" : Component.translatable("text.reactive.trace").getString();

This results in cauldron never being full on paper (and on Create display link).
2024-04-23_12 14 36
Maybe you can use double and round it to closest number instead (and maybe leave 1 character after the dot. I mean, format it like 50.4%, 49.6% instead of just 50%, 50%. A bit more precise. But up to you. Keep in mind that changing NBT value type might lead to crash on client side).

commented

The imprecision is intended, but I could have sworn it was possible for the paper to report 100% values... Either way a little rounding might be nice

commented

Possible with single power inside 🤷

commented

I might do this later, but for now I don't plan to change this. I don't want everyone to get confused when their percents change by a tiny amount.