Fixes dead entity dupe

This commit is contained in:
Sotr
2019-03-07 19:41:53 +08:00
parent 6466aa2bdb
commit f0d08c4d3f
4 changed files with 5 additions and 2 deletions

View File

@@ -188,6 +188,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public boolean fromMobSpawner;
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
protected int numCollisions = 0; // Paper
public boolean joinedWorld; // Akarin
public void inactiveTick() { }
// Spigot end

View File

@@ -1210,7 +1210,7 @@ public abstract class EntityLiving extends Entity {
}
public void die(DamageSource damagesource) {
if (!this.killed) {
if (!this.killed && !this.joinedWorld) { // Akarin
Entity entity = damagesource.getEntity();
EntityLiving entityliving = this.cv();

View File

@@ -1550,6 +1550,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
return;
}
// CraftBukkit end
entity.joinedWorld = true; // Akarin
entity.N = entity.locX;
entity.O = entity.locY;
@@ -1622,6 +1623,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
}
}
entity.joinedWorld = false; // Akarin
}
// Paper start - Based on method below