EMC Link Integer Overflow Bug
James103 opened this issue ยท 2 comments
As of Project Expansion 1.16.5-1.0.18 for Minecraft 1.16.5, it is possible to get so much EMC so as to make it so the amount of the requested item you can afford rolls past 31 bits, causing a signed integer overflow and the following code to assume you don't have enough EMC since emc.divide(BigInteger.valueOf(cost)).intValue() < 1
:
To reproduce:
- Give yourself a billion EMC:
emc add @s 1000000000
- Place down an EMC Link and set it to output stone or any other item worth 1 EMC.
- Try to take items out of the EMC link.
- Repeat steps 1-3 until you get a not enough EMC error message.