Extracting and re-inserting maximally-valuable items voids relatively tiny amounts of EMC due to imprecision
James103 opened this issue · comments
Tickets that do not conform to this template will be closed without comment
Exact ProjectE version (do not say "latest", "latest on Curse", or similar): ProjectE-1.20.1-PE1.0.1
Exact Forge version: 47.2.31
Link to crash log (please use a paste site, do not attach the .txt or paste the log inline): https://gist.github.com/James103/a79f3239706346405ddd255ea2361b2c
Steps to reproduce:
- Create a new world with cheats enabled.
- Give yourself a couple of Transmutation Tables.
- Place one down, and learn the other. You should now have 260 EMC (the value of the Transmutation Table).
- Give yourself a barrier block:
/give @s barrier
- Run this command:
projecte setemc 1234567890767676677 barrier
- Run
/reload
. - Transmute and learn the barrier block.
- Take out the barrier block.
- 5 EMC is voided. (your EMC becomes 255, 250, 245, 240, ... with each cycle)
What I expected to happen: No EMC is voided or duplicated
What happened instead: Very tiny amounts of EMC are voided or duplicated due to imprecision caused by calculations within ProjectE using 64-bit floating point numbers instead of all BigIntegers.