aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0042-Fix-lag-from-explosions-processing-dead-entities.patch
blob: 1c5b19ed1f13781742603fc8d3354762f9700edb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From 0000000000000000000000000000000000000000 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


diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java
index 9ef8b671d5f969c71ac00ec1b49874ac05ca84ac..67685dfa8eb4a74e70ef982291a55d145d6abc66 100644
--- a/src/main/java/net/minecraft/world/level/ServerExplosion.java
+++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java
@@ -185,7 +185,7 @@ public class ServerExplosion implements Explosion {
         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()) {