修复投弹无人机会撞到自己手雷的bug

This commit is contained in:
Atsuihsio 2024-12-09 23:04:51 +08:00
parent afcc826f8a
commit 205d86c9af
2 changed files with 2 additions and 2 deletions

View file

@ -13,5 +13,5 @@ mod_description=A Warfare Mod
minecraft_version=1.20.1 minecraft_version=1.20.1
jei_version=15.2.0.27 jei_version=15.2.0.27
cloth_config_version=11.1.106 cloth_config_version=11.1.106
mod_version=0.3.1 mod_version=0.3.2
mod_authors=Atsuishio, Roki27, Light_Quanta mod_authors=Atsuishio, Roki27, Light_Quanta

View file

@ -380,7 +380,7 @@ public class DroneEntity extends LivingEntity implements GeoEntity {
var level = this.level(); var level = this.level();
final Vec3 center = new Vec3(this.getX(), this.getY(), this.getZ()); final Vec3 center = new Vec3(this.getX(), this.getY(), this.getZ());
for (Entity target : level.getEntitiesOfClass(Entity.class, aabb, e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) { for (Entity target : level.getEntitiesOfClass(Entity.class, aabb, e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) {
if (this != target && target != null) { if (this != target && target != null && !(target instanceof RgoGrenadeEntity)) {
hitEntityCrash(controller, target); hitEntityCrash(controller, target);
} }
} }