testserver/Spigot-Server-Patches/0034-Fix-lag-from-explosion...

30 lines
1.4 KiB
Diff
Raw Normal View History

2016-03-31 00:50:23 +00:00
From 7db30b2993803a75446a250e1c11713a84da3f1a Mon Sep 17 00:00:00 2001
From: Iceee <andrew@opticgaming.tv>
2016-02-29 23:09:49 +00:00
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/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
2016-03-31 00:50:23 +00:00
index 69720e8..ae49403 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -103,7 +103,14 @@ public class Explosion {
int i1 = MathHelper.floor(this.posY + (double) f3 + 1.0D);
int j1 = MathHelper.floor(this.posZ - (double) f3 - 1.0D);
int k1 = MathHelper.floor(this.posZ + (double) f3 + 1.0D);
- List list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1));
2016-02-29 23:09:49 +00:00
+ // Paper start - Fix lag from explosions processing dead entities
+ List list = this.world.a(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), new com.google.common.base.Predicate<Entity>() {
+ @Override
+ public boolean apply(Entity entity) {
+ return IEntitySelector.d.apply(entity) && !entity.dead;
+ }
+ });
2016-02-29 23:09:49 +00:00
+ // Paper end
Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ);
for (int l1 = 0; l1 < list.size(); ++l1) {
--
2016-03-31 00:50:23 +00:00
2.8.0