接口 IScalingFunction
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
An
This allows finer control over the actual scaling value, instead of the hard-coded vanilla defaults.
IScalingFunction
is used by custom DamageScaling
instances.This allows finer control over the actual scaling value, instead of the hard-coded vanilla defaults.
-
字段概要
字段修饰符和类型字段说明static final IScalingFunction
Default Scaling function used by the vanillaDamageScaling
values. -
方法概要
修饰符和类型方法说明float
scaleDamage
(DamageSource source, Player target, float amount, Difficulty difficulty) Scales the incoming damage amount based on the current difficulty.
Only damage dealt to players is scaled, other damage is not impacted.
-
字段详细资料
-
DEFAULT
Default Scaling function used by the vanillaDamageScaling
values.- Implementation Note:
- Values are based on the code found in
Entity.hurt(DamageSource, float)
.
-
-
方法详细资料
-
scaleDamage
Scales the incoming damage amount based on the current difficulty.
Only damage dealt to players is scaled, other damage is not impacted.- 参数:
source
- The source of the incoming damage.target
- The player which is being attacked.amount
- The amount of damage being dealt.difficulty
- The current game difficulty.- 返回:
- The scaled damage value.
-