Several fixes and new api for experience merging/stacking (#9242)
This commit is contained in:
@@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
itemstack.setDamageValue(itemstack.getDamageValue() - j);
|
||||
- int k = amount - this.durabilityToXp(j);
|
||||
+ int k = amount - event.getDurabilityToXpOperation().applyAsInt(j); // Paper - Expand PlayerItemMendEvent
|
||||
this.value = k; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls
|
||||
// this.value = k; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls // Paper - the value field should not be mutated here because it doesn't take "count" into account
|
||||
+ // Paper start - Expand PlayerItemMendEvent
|
||||
+ if (j == 0 && amount == k) { // if repair amount is 0 and no xp was removed, don't do recursion; treat as cancelled
|
||||
+ return k;
|
||||
|
||||
Reference in New Issue
Block a user