Fix lag from explosions processing dead entities

This commit is contained in:
Iceee 2016-03-02 01:39:52 -06:00
parent b083157a8c
commit e2ead8262e

View file

@ -52,6 +52,15 @@
}
private ExplosionDamageCalculator makeDamageCalculator(@Nullable Entity entity) {
@@ -171,7 +185,7 @@
int l = Mth.floor(this.center.y + (double) f + 1.0D);
int i1 = Mth.floor(this.center.z - (double) f - 1.0D);
int j1 = Mth.floor(this.center.z + (double) f + 1.0D);
- List<Entity> list = this.level.getEntities(this.source, new AABB((double) i, (double) k, (double) i1, (double) j, (double) l, (double) j1));
+ List<Entity> list = this.level.getEntities(this.source, new AABB((double) i, (double) k, (double) i1, (double) j, (double) l, (double) j1), (com.google.common.base.Predicate<Entity>) entity -> entity.isAlive() && !entity.isSpectator()); // Paper - Fix lag from explosions processing dead entities
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
@@ -195,7 +209,35 @@
float f2 = !flag && f1 == 0.0F ? 0.0F : ServerExplosion.getSeenPercent(this.center, entity);