mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
Fix EntityDeathEvent cancellation (#9323)
This commit is contained in:
parent
1fcfe34f7f
commit
04928c58a4
1 changed files with 6 additions and 3 deletions
|
@ -137,12 +137,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ this.clearedEquipmentSlots.clear();
|
+ this.clearedEquipmentSlots.clear();
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
|
||||||
|
- if (entity == null || entity.killedEntity(worldserver, this)) {
|
||||||
+ if (this.isSleeping()) {
|
+ if (this.isSleeping()) {
|
||||||
+ this.stopSleeping();
|
+ this.stopSleeping();
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
- if (entity == null || entity.killedEntity(worldserver, this)) {
|
|
||||||
+ if (!this.level().isClientSide && this.hasCustomName()) {
|
+ if (!this.level().isClientSide && this.hasCustomName()) {
|
||||||
+ if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
|
+ if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
|
||||||
+ }
|
+ }
|
||||||
|
@ -154,6 +154,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||||
- this.dropAllDeathLoot(damageSource);
|
- this.dropAllDeathLoot(damageSource);
|
||||||
- this.createWitherRose(entityliving);
|
- this.createWitherRose(entityliving);
|
||||||
|
+ } else {
|
||||||
|
+ this.dead = false;
|
||||||
|
+ this.setHealth((float) deathEvent.getReviveHealth());
|
||||||
}
|
}
|
||||||
|
|
||||||
- this.level().broadcastEntityEvent(this, (byte) 3);
|
- this.level().broadcastEntityEvent(this, (byte) 3);
|
||||||
|
|
Loading…
Reference in a new issue