mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Fix NPE when EntityResurrectEvent is uncancelled (#11636)
This commit is contained in:
parent
938559b3e0
commit
a44e23c205
1 changed files with 23 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
|
||||
Date: Mon, 18 Nov 2024 20:27:58 +0100
|
||||
Subject: [PATCH] Fix NPE when EntityResurrectEvent is uncancelled
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
if (!itemstack1.isEmpty() && itemstack != null) { // Paper - only reduce item if actual totem was found
|
||||
itemstack1.shrink(1);
|
||||
}
|
||||
+ // Paper start - fix NPE when pre-cancelled EntityResurrectEvent is uncancelled
|
||||
+ // restore the previous behavior in that case by defaulting to vanillas totem of undying efect
|
||||
+ if (deathprotection == null) {
|
||||
+ deathprotection = DeathProtection.TOTEM_OF_UNDYING;
|
||||
+ }
|
||||
+ // Paper end - fix NPE when pre-cancelled EntityResurrectEvent is uncancelled
|
||||
if (itemstack != null && this instanceof ServerPlayer) {
|
||||
// CraftBukkit end
|
||||
ServerPlayer entityplayer = (ServerPlayer) this;
|
Loading…
Reference in a new issue