修改载具减伤计算方法
This commit is contained in:
parent
1a522bf5c2
commit
6ca9f4d478
2 changed files with 3 additions and 6 deletions
|
@ -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))
|
if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.IN_WALL))
|
||||||
return false;
|
return false;
|
||||||
// 计算减伤后的伤害
|
// 计算减伤后的伤害
|
||||||
float computedAmount;
|
float computedAmount = getDamageModifier().compute(source, amount);
|
||||||
if (this.level().isClientSide) {
|
|
||||||
computedAmount = amount;
|
|
||||||
} else {
|
|
||||||
computedAmount = getDamageModifier().compute(source, amount);
|
|
||||||
}
|
|
||||||
this.crash = source.is(ModDamageTypes.VEHICLE_STRIKE);
|
this.crash = source.is(ModDamageTypes.VEHICLE_STRIKE);
|
||||||
|
|
||||||
if (source.getEntity() != null) {
|
if (source.getEntity() != null) {
|
||||||
|
|
|
@ -110,6 +110,8 @@ public class DamageModify {
|
||||||
* @return 伤害来源是否符合条件
|
* @return 伤害来源是否符合条件
|
||||||
*/
|
*/
|
||||||
public boolean match(DamageSource source) {
|
public boolean match(DamageSource source) {
|
||||||
|
if (source == null) return false;
|
||||||
|
|
||||||
if (sourceType == null) {
|
if (sourceType == null) {
|
||||||
generateSourceType();
|
generateSourceType();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue