mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 22:40:21 +01:00
b8a0541ccf
Prevent division by zero in Player#applyMending by simply using zero instead if the divider itself is zero. This matches vanilla behaviour in the sense that ExperienceOrb#repairPlayerItems, which this logic is lifted from, does pass zero to the enchantment helper and runs its first iteration on repairing. Vanilla is not affected as the computation failing with zero is used to compute the leftover exp value, which is not needed if zero itself is passed in. As the paper impl however exposes said value to the initial event, our code needs to account for the zero division. |
||
---|---|---|
.. | ||
patches | ||
src | ||
build.gradle.kts | ||
LGPL.txt | ||
LICENCE.txt |