From e2ead8262e9ece15373b2409903da8cba7cbb954 Mon Sep 17 00:00:00 2001
From: Iceee <andrew@opticgaming.tv>
Date: Wed, 2 Mar 2016 01:39:52 -0600
Subject: [PATCH] Fix lag from explosions processing dead entities

---
 .../net/minecraft/world/level/ServerExplosion.java.patch | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/paper-server/patches/sources/net/minecraft/world/level/ServerExplosion.java.patch b/paper-server/patches/sources/net/minecraft/world/level/ServerExplosion.java.patch
index 6f2b9013c4..6d7d4a7cc1 100644
--- a/paper-server/patches/sources/net/minecraft/world/level/ServerExplosion.java.patch
+++ b/paper-server/patches/sources/net/minecraft/world/level/ServerExplosion.java.patch
@@ -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);