aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0042-Fix-lag-from-explosions-processing-dead-entities.patch
blob: 9dc78a5f91dd93d80f3d5a17d6d544254cb7d695 (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 1df33018470136344d8843e5e429aa7f9b40b750..0eb25fabfff0e8a050c6dfb8cd24e703f679db76 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()) {