SPIGOT-5278: EntityDrowned memory leak

This commit is contained in:
md_5 2019-08-24 19:45:08 +10:00
parent 7055c93117
commit 2439178eab

View file

@ -333,7 +333,17 @@
return true;
}
}
@@ -879,6 +994,7 @@
@@ -875,10 +990,17 @@
}
this.getScoreboard().a(entity);
+ // CraftBukkit start - SPIGOT-5278
+ if (entity instanceof EntityDrowned) {
+ this.H.remove(((EntityDrowned) entity).b);
+ this.H.remove(((EntityDrowned) entity).c);
+ } else
+ // CraftBukkit end
if (entity instanceof EntityInsentient) {
this.H.remove(((EntityInsentient) entity).getNavigation());
}
@ -341,7 +351,16 @@
}
private void registerEntity(Entity entity) {
@@ -902,6 +1018,7 @@
@@ -899,9 +1021,16 @@
this.entitiesByUUID.put(entity.getUniqueID(), entity);
this.getChunkProvider().addEntity(entity);
+ // CraftBukkit start - SPIGOT-5278
+ if (entity instanceof EntityDrowned) {
+ this.H.add(((EntityDrowned) entity).b);
+ this.H.add(((EntityDrowned) entity).c);
+ } else
+ // CraftBukkit end
if (entity instanceof EntityInsentient) {
this.H.add(((EntityInsentient) entity).getNavigation());
}
@ -349,7 +368,7 @@
}
}
@@ -932,6 +1049,18 @@
@@ -932,6 +1061,18 @@
}
public void strikeLightning(EntityLightning entitylightning) {
@ -368,7 +387,7 @@
this.globalEntityList.add(entitylightning);
this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, 512.0D, this.worldProvider.getDimensionManager(), new PacketPlayOutSpawnEntityWeather(entitylightning));
}
@@ -940,6 +1069,12 @@
@@ -940,6 +1081,12 @@
public void a(int i, BlockPosition blockposition, int j) {
Iterator iterator = this.server.getPlayerList().getPlayers().iterator();
@ -381,7 +400,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@@ -948,6 +1083,12 @@
@@ -948,6 +1095,12 @@
double d1 = (double) blockposition.getY() - entityplayer.locY;
double d2 = (double) blockposition.getZ() - entityplayer.locZ;
@ -394,7 +413,7 @@
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
}
@@ -1008,6 +1149,14 @@
@@ -1008,6 +1161,14 @@
@Override
public Explosion createExplosion(@Nullable Entity entity, DamageSource damagesource, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
@ -409,7 +428,7 @@
Explosion explosion = new Explosion(this, entity, d0, d1, d2, f, flag, explosion_effect);
if (damagesource != null) {
@@ -1016,6 +1165,8 @@
@@ -1016,6 +1177,8 @@
explosion.a();
explosion.a(false);
@ -418,7 +437,7 @@
if (explosion_effect == Explosion.Effect.NONE) {
explosion.clearBlocks();
}
@@ -1080,13 +1231,20 @@
@@ -1080,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) {
@ -441,7 +460,7 @@
++j;
}
}
@@ -1169,7 +1327,13 @@
@@ -1169,7 +1339,13 @@
@Override
public WorldMap a(String s) {
return (WorldMap) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().b(() -> {