Fix TNT not pushing creative players
This commit is contained in:
@@ -82,7 +82,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ Vec3D direction = this.getLookDirection();
|
+ Vec3D direction = this.getLookDirection();
|
||||||
+ Vec3D end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance);
|
+ Vec3D end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance);
|
||||||
+
|
+
|
||||||
+ List<Entity> entityList = world.getEntities(this, getBoundingBox().expand(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).grow(1.0D, 1.0D, 1.0D), IEntitySelector.notSpectator().and(Entity::isInteractable));
|
+ List<Entity> entityList = world.getEntities(this, getBoundingBox().expand(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).grow(1.0D, 1.0D, 1.0D), IEntitySelector.canAITarget().and(Entity::isInteractable));
|
||||||
+
|
+
|
||||||
+ double distance = 0.0D;
|
+ double distance = 0.0D;
|
||||||
+ MovingObjectPositionEntity result = null;
|
+ MovingObjectPositionEntity result = null;
|
||||||
@@ -115,7 +115,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public static final Predicate<Entity> e = (entity) -> {
|
public static final Predicate<Entity> e = (entity) -> {
|
||||||
return !(entity instanceof EntityHuman) || !entity.isSpectator() && !((EntityHuman) entity).isCreative();
|
return !(entity instanceof EntityHuman) || !entity.isSpectator() && !((EntityHuman) entity).isCreative();
|
||||||
};
|
};
|
||||||
+ public static Predicate<Entity> notSpectator() { return f; } // Paper - OBFHELPER
|
+ public static Predicate<Entity> canAITarget() { return f; } // Paper - OBFHELPER
|
||||||
public static final Predicate<Entity> f = (entity) -> {
|
public static final Predicate<Entity> f = (entity) -> {
|
||||||
return !(entity instanceof EntityHuman) || !entity.isSpectator() && !((EntityHuman) entity).isCreative() && entity.world.getDifficulty() != EnumDifficulty.PEACEFUL;
|
return !(entity instanceof EntityHuman) || !entity.isSpectator() && !((EntityHuman) entity).isCreative() && entity.world.getDifficulty() != EnumDifficulty.PEACEFUL;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,19 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
int j1 = MathHelper.floor(this.posZ - (double) f2 - 1.0D);
|
int j1 = MathHelper.floor(this.posZ - (double) f2 - 1.0D);
|
||||||
int k1 = MathHelper.floor(this.posZ + (double) f2 + 1.0D);
|
int k1 = MathHelper.floor(this.posZ + (double) f2 + 1.0D);
|
||||||
- List<Entity> list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1));
|
- List<Entity> list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1));
|
||||||
+ 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
|
+ 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 -> entity.isAlive() && !entity.isSpectator()); // Paper - Fix lag from explosions processing dead entities
|
||||||
Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ);
|
Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ);
|
||||||
|
|
||||||
for (int l1 = 0; l1 < list.size(); ++l1) {
|
for (int l1 = 0; l1 < list.size(); ++l1) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
|
|
||||||
@@ -0,0 +0,0 @@ public final class IEntitySelector {
|
|
||||||
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) -> {
|
|
||||||
return !(entity instanceof EntityHuman) || !entity.isSpectator() && !((EntityHuman) entity).isCreative();
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user