PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
10.04k stars 2.34k forks source link

XP-Orb merging broken #936

Closed minoneer closed 7 years ago

minoneer commented 7 years ago

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)

zachbr commented 7 years ago

Builds 1256+ will include this fix, thanks for reporting.

minoneer commented 7 years ago

Thanks for the fast fix