aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0071-Remove-Metadata-on-reload.patch
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2024-06-10 08:24:52 +0200
committerGitHub <[email protected]>2024-06-10 08:24:52 +0200
commit906df69f05d0779906377abb809bfec9fc3c3546 (patch)
tree280702c614c143f7e3ea32b2a0dd283b452e2e06 /patches/server/0071-Remove-Metadata-on-reload.patch
parentbd5867a96f792f0eb32c1d249bb4bbc1d8338d14 (diff)
downloadPaper-906df69f05d0779906377abb809bfec9fc3c3546.tar.gz
Paper-906df69f05d0779906377abb809bfec9fc3c3546.zip
Prevent internal NPE on ItemStack#damage (#10836)
ItemStack#damage internally uses ItemStack#hurtAndBreak, which previously would call a Consumer in case the item broke. Since 1.20.5 the break game event logic however resides in said method and was using the equipment slot passed, which is null in the case of the API ItemStack#damage method. This commit prevents the NPE by first null checking the slot. Addittionally, hurtAndBreak also now checks if the player has infinite materials, e.g. is in creative mode, to prevent damaging the item. As such as filter is undesirable for API calls, this commit also skips this logic in case of an API invocation.
Diffstat (limited to 'patches/server/0071-Remove-Metadata-on-reload.patch')
0 files changed, 0 insertions, 0 deletions