还是优化1130

This commit is contained in:
Atsuishio 2025-04-30 11:48:44 +08:00 committed by Light_Quanta
parent c202716a89
commit b5cb9b42d1
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
2 changed files with 5 additions and 5 deletions

View file

@ -284,7 +284,7 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti
return;
}
Vec3 targetPos = new Vec3(target.getX(), target.getY() + target.getBbHeight() / 2, target.getZ()).add(target.getDeltaMovement().scale(4 + 0.025 * target.distanceTo(this)));
Vec3 targetPos = new Vec3(target.getX(), target.getY() + target.getBbHeight() / 2, target.getZ()).add(target.getDeltaMovement().scale((4 + 0.025 * target.distanceTo(this)) * random.nextFloat() * 0.2f + 1));
Vec3 targetVec = barrelRootPos.vectorTo(targetPos).normalize();
double d0 = targetVec.x;
@ -299,7 +299,7 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti
turretTurnSound(0, diffY, 1.1f);
this.setYRot(this.getYRot() + Mth.clamp(0.9f * diffY, -20f, 20f));
if (target.distanceTo(this) <= 144 && VectorTool.calculateAngle(getViewVector(1), targetVec) < 3) {
if (target.distanceTo(this) <= 144 && VectorTool.calculateAngle(getViewVector(1), targetVec) < 10) {
if (checkNoClip(target) && entityData.get(AMMO) > 0) {
vehicleShoot(player, 0);
@ -383,7 +383,7 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti
public Entity seekThreateningEntity() {
return StreamSupport.stream(EntityFindUtil.getEntities(level()).getAll().spliterator(), false)
.filter(e -> {
if (!e.onGround() && e instanceof Projectile && e.getDeltaMovement().length() < 15 && VectorTool.calculateAngle(e.getDeltaMovement().normalize(), e.position().vectorTo(this.position()).normalize()) < 30) {
if (!e.onGround() && e instanceof Projectile && (e.getBbWidth() >= 0.3 || e.getBbHeight() >= 0.3) && VectorTool.calculateAngle(e.getDeltaMovement().normalize(), e.position().vectorTo(this.position()).normalize()) < 30) {
return checkNoClip(e);
}
return false;

View file

@ -49,7 +49,7 @@ public class ModEntities {
// Projectiles
public static final DeferredHolder<EntityType<?>, EntityType<TaserBulletEntity>> TASER_BULLET = register("taser_bullet",
EntityType.Builder.<TaserBulletEntity>of(TaserBulletEntity::new, MobCategory.MISC).noSave().setTrackingRange(64)
.setUpdateInterval(1).sized(0.5f, 0.5f));
.setUpdateInterval(1).sized(0.25f, 0.25f));
// Fast Projectiles
public static final DeferredHolder<EntityType<?>, EntityType<SmallCannonShellEntity>> SMALL_CANNON_SHELL = register("small_cannon_shell",
@ -61,7 +61,7 @@ public class ModEntities {
public static final DeferredHolder<EntityType<?>, EntityType<ProjectileEntity>> PROJECTILE = register("projectile",
EntityType.Builder.<ProjectileEntity>of(ProjectileEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).noSave().noSummon().sized(0.25f, 0.25f));
public static final DeferredHolder<EntityType<?>, EntityType<CannonShellEntity>> CANNON_SHELL = register("cannon_shell",
EntityType.Builder.<CannonShellEntity>of(CannonShellEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f));
EntityType.Builder.<CannonShellEntity>of(CannonShellEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.75f, 0.75f));
public static final DeferredHolder<EntityType<?>, EntityType<GunGrenadeEntity>> GUN_GRENADE = register("gun_grenade",
EntityType.Builder.<GunGrenadeEntity>of(GunGrenadeEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(false).noSave().setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f));
public static final DeferredHolder<EntityType<?>, EntityType<MelonBombEntity>> MELON_BOMB = register("melon_bomb",