修改载具减伤计算方法

This commit is contained in:
17146 2025-05-31 15:32:21 +08:00 committed by Light_Quanta
parent 1a522bf5c2
commit 6ca9f4d478
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
2 changed files with 3 additions and 6 deletions

View file

@ -406,12 +406,7 @@ public abstract class VehicleEntity extends Entity {
if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.IN_WALL))
return false;
// 计算减伤后的伤害
float computedAmount;
if (this.level().isClientSide) {
computedAmount = amount;
} else {
computedAmount = getDamageModifier().compute(source, amount);
}
float computedAmount = getDamageModifier().compute(source, amount);
this.crash = source.is(ModDamageTypes.VEHICLE_STRIKE);
if (source.getEntity() != null) {

View file

@ -110,6 +110,8 @@ public class DamageModify {
* @return 伤害来源是否符合条件
*/
public boolean match(DamageSource source) {
if (source == null) return false;
if (sourceType == null) {
generateSourceType();
}