Since the last time we updated (from ~ build 1240), we sometimes have XP-Orbs with negative value. These cause weapons with repair enchantment to lose durability instead of gaining.
Cause
Commit 072d6ec8cbd6bf49cf2d109bcca584fc129ab66c introduced a limit for XP-Orb merging. But in its current form it has an issue:
The merge is undone if the orb value is larger than the max value (L42). So even in cases where the max value is set to -1 (default = infinte merging), the merge is undone. This results in orbs never merging with the default value (expected is infinite merging like spigot default) and negative xp values, as max value is directly assigned in L44.
Paper build number:
Paper version git-Paper-1253 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)
Bug
Since the last time we updated (from ~ build 1240), we sometimes have XP-Orbs with negative value. These cause weapons with repair enchantment to lose durability instead of gaining.
Cause
Commit 072d6ec8cbd6bf49cf2d109bcca584fc129ab66c introduced a limit for XP-Orb merging. But in its current form it has an issue:
The merge is undone if the orb value is larger than the max value (L42). So even in cases where the max value is set to -1 (default = infinte merging), the merge is undone. This results in orbs never merging with the default value (expected is infinite merging like spigot default) and negative xp values, as max value is directly assigned in L44.
Paper build number:
Paper version git-Paper-1253 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)