Cleanup damage source a bit (#12106)
This commit is contained in:
@@ -678,7 +678,7 @@
|
||||
+ event.setCancelled(itemStack == null);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ // Set death protection to null as the event was cancelled. Prevent any attempt at ressurection.
|
||||
+ // Set death protection to null as the event was cancelled. Prevent any attempt at resurrection.
|
||||
+ deathProtection = null;
|
||||
+ } else {
|
||||
+ if (!itemInHand.isEmpty() && itemStack != null) { // Paper - only reduce item if actual totem was found
|
||||
@@ -691,7 +691,7 @@
|
||||
- if (this instanceof ServerPlayer serverPlayer) {
|
||||
+ }
|
||||
+ // 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
|
||||
+ // restore the previous behavior in that case by defaulting to vanillas totem of undying effect
|
||||
+ if (deathProtection == null) {
|
||||
+ deathProtection = DeathProtection.TOTEM_OF_UNDYING;
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user