调整部分数据

This commit is contained in:
Atsuihsio 2025-03-05 02:24:23 +08:00
parent f81ab2e4eb
commit 296f8d30e6
4 changed files with 17 additions and 5 deletions

View file

@ -269,9 +269,10 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
this.rightInputDown = false;
this.forwardInputDown = false;
this.backInputDown = false;
this.setZRot(this.roll * 0.8f);
this.setXRot(this.getXRot() * 0.8f);
this.entityData.set(POWER, this.entityData.get(POWER) * 0.98f);
this.upInputDown = false;
this.downInputDown = false;
this.setZRot(this.roll * 0.98f);
this.setXRot(this.getXRot() * 0.98f);
} else if (passenger instanceof Player) {
diffY = Math.clamp(-90f, 90f, Mth.wrapDegrees(passenger.getYHeadRot() - this.getYRot()));
diffX = Math.clamp(-60f, 60f, Mth.wrapDegrees(passenger.getXRot() - this.getXRot()));

View file

@ -156,6 +156,17 @@ public class VehicleEntity extends Entity {
return InteractionResult.PASS;
}
public double getYRotFromVector(Vec3 vec3) {
this.setDeltaMovement(vec3);
return Mth.atan2(vec3.x, vec3.z) * (180F / Math.PI);
}
public double getXRotFromVector(Vec3 vec3) {
this.setDeltaMovement(vec3);
double d0 = vec3.horizontalDistance();
return Mth.atan2(vec3.y, d0) * (180F / Math.PI);
}
@Override
public boolean hurt(@NotNull DamageSource source, float amount) {
// 计算减伤后的伤害

View file

@ -147,7 +147,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
.multiply(0.2f, ModDamageTypes.PROJECTILE_BOOM)
.multiply(0.1f, ModDamageTypes.MINE)
.multiply(0.1f, ModDamageTypes.LUNGE_MINE)
.multiply(0.15f, ModDamageTypes.CANNON_FIRE)
.multiply(0.22f, ModDamageTypes.CANNON_FIRE)
.multiply(0.05f, ModTags.DamageTypes.PROJECTILE_ABSOLUTE)
.reduce(9);
}

View file

@ -89,7 +89,7 @@ public class ModEntities {
public static final RegistryObject<EntityType<LaserTowerEntity>> LASER_TOWER = register("laser_tower",
EntityType.Builder.<LaserTowerEntity>of(LaserTowerEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(LaserTowerEntity::new).fireImmune().sized(0.9f, 1.65f));
public static final RegistryObject<EntityType<Yx100Entity>> YX_100 = register("yx_100",
EntityType.Builder.<Yx100Entity>of(Yx100Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Yx100Entity::new).fireImmune().sized(6f, 3.5f));
EntityType.Builder.<Yx100Entity>of(Yx100Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Yx100Entity::new).fireImmune().sized(5.5f, 3.25f));
public static final RegistryObject<EntityType<Yx100GunEntity>> YX_100_GUN = register("yx_100_gun",
EntityType.Builder.<Yx100GunEntity>of(Yx100GunEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Yx100GunEntity::new).fireImmune().sized(0.9f, 0.65f));