优化防御塔目标选择
This commit is contained in:
parent
eef5bc9a0c
commit
369169ec75
1 changed files with 4 additions and 0 deletions
|
@ -280,6 +280,10 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity,
|
|||
Entity target = EntityFindUtil.findEntity(level(), entityData.get(TARGET_UUID));
|
||||
|
||||
if (target != null) {
|
||||
if (target instanceof LivingEntity living && living.getHealth() <= 0) {
|
||||
entityData.set(TARGET_UUID, "none");
|
||||
return;
|
||||
}
|
||||
Vec3 barrelRootPos = new Vec3(this.getX(), this.getY() + 1.390625f, this.getZ());
|
||||
Vec3 targetVec = barrelRootPos.vectorTo(target.getEyePosition()).normalize();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue