mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Ensure entity is always dying before Death Event
Prior to this it was possible for plugins to put the server into a never ending recursive loop until it eventually killed itself. Fixes GH-1432
This commit is contained in:
parent
e0c865681c
commit
463e6dac06
2 changed files with 4 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -34,6 +34,7 @@ work/Spigot-Server
|
||||||
work/Spigot-API
|
work/Spigot-API
|
||||||
work/*.jar
|
work/*.jar
|
||||||
work/test-server
|
work/test-server
|
||||||
|
work/ForgeFlower
|
||||||
|
|
||||||
# Mac filesystem dust
|
# Mac filesystem dust
|
||||||
.DS_Store/
|
.DS_Store/
|
||||||
|
|
|
@ -69,7 +69,7 @@ index dca497072..454c1e7d0 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
index 14637be49..dec4b442c 100644
|
index 14637be49..5ccd3ea6f 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||||
|
@ -140,7 +140,7 @@ index 14637be49..dec4b442c 100644
|
||||||
|
|
||||||
- this.aU = true;
|
- this.aU = true;
|
||||||
- this.getCombatTracker().g();
|
- this.getCombatTracker().g();
|
||||||
+ //this.aU = true;
|
+ this.aU = true; // Paper - Always set at start, unset later if cancelled - GH-1432
|
||||||
+ //this.getCombatTracker().g();
|
+ //this.getCombatTracker().g();
|
||||||
+
|
+
|
||||||
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = null;
|
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = null;
|
||||||
|
@ -178,6 +178,7 @@ index 14637be49..dec4b442c 100644
|
||||||
+ this.setDying(true);
|
+ this.setDying(true);
|
||||||
+ this.world.broadcastEntityEffect(this, (byte) 3);
|
+ this.world.broadcastEntityEffect(this, (byte) 3);
|
||||||
+ } else {
|
+ } else {
|
||||||
|
+ this.setDying(false); // Paper - reset if cancelled
|
||||||
+ this.setHealth((float) deathEvent.getReviveHealth());
|
+ this.setHealth((float) deathEvent.getReviveHealth());
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
|
Loading…
Reference in a new issue