2020-05-06 09:48:49 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2015-06-02 05:56:10 +00:00
From: Iceee <andrew@opticgaming.tv>
2016-02-29 23:09:49 +00:00
Date: Wed, 2 Mar 2016 01:39:52 -0600
2015-06-02 05:56:10 +00:00
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
2020-06-25 09:27:25 +00:00
index 692625d9f80b6e98ba4bb6c94c71e6b59ba36d6a..bf156897acfe25c16a1b09a83a00ba3ab647a2dd 100644
2015-06-02 05:56:10 +00:00
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
2020-06-25 09:27:25 +00:00
@@ -153,7 +153,7 @@ public class Explosion {
int i1 = MathHelper.floor(this.posY + (double) f2 + 1.0D);
int j1 = MathHelper.floor(this.posZ - (double) f2 - 1.0D);
int k1 = MathHelper.floor(this.posZ + (double) f2 + 1.0D);
2019-01-01 03:15:55 +00:00
- List<Entity> list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1));
2020-06-25 09:27:25 +00:00
+ List<Entity> list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), (com.google.common.base.Predicate<Entity>) entity -> IEntitySelector.canAITarget().test(entity) && !entity.dead); // Paper - Fix lag from explosions processing dead entities
2015-06-02 05:56:10 +00:00
Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ);
for (int l1 = 0; l1 < list.size(); ++l1) {
2018-09-23 02:28:16 +00:00
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
2020-06-25 09:27:25 +00:00
index ed7566591bac72d17b40a940531b7feb1cb8f392..d7e3580067bcbca09b66f05f02e8736863bd7ef5 100644
2018-09-23 02:28:16 +00:00
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
2019-01-01 03:15:55 +00:00
@@ -14,6 +14,7 @@ public final class IEntitySelector {
2018-09-23 02:28:16 +00:00
public static final Predicate<Entity> d = (entity) -> {
return entity instanceof IInventory && entity.isAlive();
};
+ public static Predicate<Entity> canAITarget() { return e; } // Paper - OBFHELPER
public static final Predicate<Entity> e = (entity) -> {
2019-06-03 03:26:25 +00:00
return !(entity instanceof EntityHuman) || !entity.isSpectator() && !((EntityHuman) entity).isCreative();
2018-09-23 02:28:16 +00:00
};