This commit is contained in:
Light_Quanta 2025-06-23 22:05:06 +08:00
parent 99a2482f7f
commit e1273d2cc2
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -483,6 +483,8 @@ public abstract class VehicleEntity extends Entity {
if (source.getDirectEntity() instanceof Projectile projectile && this instanceof OBBEntity) {
OBBHitter accessor = OBBHitter.getInstance(projectile);
var part = accessor.sbw$getCurrentHitPart();
if (part != null) {
switch (part) {
case TURRET -> entityData.set(TURRET_HEALTH, entityData.get(TURRET_HEALTH) - computedAmount);
case WHEEL_LEFT -> entityData.set(L_WHEEL_HEALTH, entityData.get(L_WHEEL_HEALTH) - computedAmount);
@ -491,6 +493,7 @@ public abstract class VehicleEntity extends Entity {
case ENGINE2 -> entityData.set(L_ENGINE_HEALTH, entityData.get(L_ENGINE_HEALTH) - computedAmount);
}
}
}
this.onHurt(computedAmount, source.getEntity(), true);
return super.hurt(source, computedAmount);