3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-23 14:50:08 +01:00

SPIGOT-4774: Entities don't get marked 'invalid' after being removed

Dieser Commit ist enthalten in:
blablubbabc 2019-04-27 09:25:38 +10:00 committet von md_5
Ursprung 6de3aa179a
Commit 401641ea6d

Datei anzeigen

@ -330,7 +330,15 @@
return true; return true;
} }
} }
@@ -899,6 +1019,7 @@ @@ -876,6 +996,7 @@
this.I.remove(((EntityInsentient) entity).getNavigation());
}
+ entity.valid = false; // CraftBukkit
}
private void registerEntity(Entity entity) {
@@ -899,6 +1020,7 @@
if (entity instanceof EntityInsentient) { if (entity instanceof EntityInsentient) {
this.I.add(((EntityInsentient) entity).getNavigation()); this.I.add(((EntityInsentient) entity).getNavigation());
} }
@ -338,7 +346,7 @@
} }
} }
@@ -929,6 +1050,18 @@ @@ -929,6 +1051,18 @@
} }
public void strikeLightning(EntityLightning entitylightning) { public void strikeLightning(EntityLightning entitylightning) {
@ -357,7 +365,7 @@
this.globalEntityList.add(entitylightning); this.globalEntityList.add(entitylightning);
this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, 512.0D, this.worldProvider.getDimensionManager(), new PacketPlayOutSpawnEntityWeather(entitylightning)); this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, 512.0D, this.worldProvider.getDimensionManager(), new PacketPlayOutSpawnEntityWeather(entitylightning));
} }
@@ -937,6 +1070,12 @@ @@ -937,6 +1071,12 @@
public void a(int i, BlockPosition blockposition, int j) { public void a(int i, BlockPosition blockposition, int j) {
Iterator iterator = this.server.getPlayerList().getPlayers().iterator(); Iterator iterator = this.server.getPlayerList().getPlayers().iterator();
@ -370,7 +378,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next(); EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@@ -945,6 +1084,12 @@ @@ -945,6 +1085,12 @@
double d1 = (double) blockposition.getY() - entityplayer.locY; double d1 = (double) blockposition.getY() - entityplayer.locY;
double d2 = (double) blockposition.getZ() - entityplayer.locZ; double d2 = (double) blockposition.getZ() - entityplayer.locZ;
@ -383,7 +391,7 @@
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) { if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, blockposition, j)); entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
} }
@@ -955,12 +1100,14 @@ @@ -955,12 +1101,14 @@
@Override @Override
public void a(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, SoundEffect soundeffect, SoundCategory soundcategory, float f, float f1) { public void a(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, SoundEffect soundeffect, SoundCategory soundcategory, float f, float f1) {
@ -400,7 +408,7 @@
} }
@Override @Override
@@ -970,7 +1117,8 @@ @@ -970,7 +1118,8 @@
@Override @Override
public void a(@Nullable EntityHuman entityhuman, int i, BlockPosition blockposition, int j) { public void a(@Nullable EntityHuman entityhuman, int i, BlockPosition blockposition, int j) {
@ -410,7 +418,7 @@
} }
@Override @Override
@@ -1005,6 +1153,14 @@ @@ -1005,6 +1154,14 @@
@Override @Override
public Explosion createExplosion(@Nullable Entity entity, DamageSource damagesource, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) { public Explosion createExplosion(@Nullable Entity entity, DamageSource damagesource, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
@ -425,7 +433,7 @@
Explosion explosion = new Explosion(this, entity, d0, d1, d2, f, flag, explosion_effect); Explosion explosion = new Explosion(this, entity, d0, d1, d2, f, flag, explosion_effect);
if (damagesource != null) { if (damagesource != null) {
@@ -1013,6 +1169,8 @@ @@ -1013,6 +1170,8 @@
explosion.a(); explosion.a();
explosion.a(false); explosion.a(false);
@ -434,7 +442,7 @@
if (explosion_effect == Explosion.Effect.NONE) { if (explosion_effect == Explosion.Effect.NONE) {
explosion.clearBlocks(); explosion.clearBlocks();
} }
@@ -1040,7 +1198,8 @@ @@ -1040,7 +1199,8 @@
BlockActionData blockactiondata = (BlockActionData) this.J.removeFirst(); BlockActionData blockactiondata = (BlockActionData) this.J.removeFirst();
if (this.a(blockactiondata)) { if (this.a(blockactiondata)) {
@ -444,7 +452,7 @@
} }
} }
@@ -1083,13 +1242,20 @@ @@ -1083,13 +1243,20 @@
} }
public <T extends ParticleParam> int a(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) { public <T extends ParticleParam> int a(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
@ -467,7 +475,7 @@
++j; ++j;
} }
} }
@@ -1172,7 +1338,13 @@ @@ -1172,7 +1339,13 @@
@Override @Override
public WorldMap a(String s) { public WorldMap a(String s) {
return (WorldMap) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().b(() -> { return (WorldMap) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().b(() -> {