PaperMC/paper-server/patches/sources/net/minecraft/world
Bjarne Koll d648e75653 Correctly shrink items during EntityResurrectEvent
The EntityResurrectEvent logic is supposed to locate a totem of undying
in any of the interaction slots of the player inventory and then, if the
called EntityResurrectEvent is not cancelled, shrink that item by 1,
usually reducing it to zero.

For this, the logic iterates over the items in the interaction slots and
breaks out the loop if a totem of undying was found.
However, even if no totem of undying was found, the iteration item stack
variable remains as a refernce to the last interaction slot probed.

Plugins uncancelling a EntityResurrectEvent, which is published
pre-cancelled to listeners if no totem of undying could be found,
would hence cause the server logic to shrink completely unrelated items
found in, at the writing of this patch, the players off hand slot.

This patch corrects this behaviour by only shrinking the item if a totem
of undying was found and the event was called uncancelled.
2023-01-10 21:06:42 +01:00
..
damagesource Add critical damage API 2021-07-26 17:32:36 +02:00
effect Fire EntityChangeBlockEvent in more places 2021-08-09 20:45:46 -07:00
entity Correctly shrink items during EntityResurrectEvent 2023-01-10 21:06:42 +01:00
food EntityRegainHealthEvent isFastRegen API 2016-04-22 01:43:11 -05:00
inventory Add PlayerInventorySlotChangeEvent 2022-04-24 22:56:59 +02:00
item ItemStack damage API 2022-05-08 13:35:45 -07:00
level Improve PortalEvents 2022-12-15 10:33:39 -08:00
scores Don't save empty scoreboard teams to scoreboard.dat 2016-05-07 23:33:08 -04:00
BossEvent.java.patch Adventure 2021-01-29 17:54:03 +01:00
CompoundContainer.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
Container.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
RandomizableContainer.java.patch LootTable API and replenishable lootables 2016-05-01 21:19:14 -04:00
SimpleContainer.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00