Paper/Spigot-Server-Patches/0029-Fix-lag-from-explosions-processing-dead-entities.patch
Aikar 33a6de0f13
Add Ban Methods to Player Objects
Allows a more logical API for banning players.

player.banPlayer("Breaking the rules");
2018-04-28 11:31:26 -04:00

30 lines
1.4 KiB
Diff

From 546315b2c4410127330c66a51e4dc275640dde34 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/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index 98c2bdcf7..a1ebcf858 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -104,7 +104,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));
+ // Paper start - Fix lag from explosions processing dead entities
+ List list = this.world.getEntities(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;
+ }
+ });
+ // Paper end
Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ);
for (int l1 = 0; l1 < list.size(); ++l1) {
--
2.17.0