2525package org .spongepowered .api .event .cause .entity .damage ;
2626
2727import org .spongepowered .api .Sponge ;
28- import org .spongepowered .api .event .Cause ;
28+ import org .spongepowered .api .event .CauseStackManager ;
2929
3030import java .util .Optional ;
31+ import java .util .function .Consumer ;
3132
3233/**
33- * A damage modifier that is or may become a {@link DamageStep}.
34+ * A damage modifier that will create a {@link DamageStep}.
3435 */
3536public interface DamageModifier {
3637
@@ -42,20 +43,19 @@ public interface DamageModifier {
4243 DamageStepType type ();
4344
4445 /**
45- * Gets the {@link Cause} of this modifier .
46+ * Gets the consumer that will modify the cause frame .
4647 *
47- * @return The cause
48+ * @return The cause frame modifier
4849 */
49- Cause cause ();
50+ Optional < Consumer < CauseStackManager . StackFrame >> frame ();
5051
5152 /**
52- * Gets the function that modify the damage.
53- * The function may be absent if the sole purpose of this modifier is to apply children steps,
54- * or if the step was made by the platform, usually the root step.
53+ * Gets the function that will modify the damage.
54+ * The function may be absent if the sole purpose of this modifier is to apply children steps.
5555 *
56- * @return the modifier function
56+ * @return the damage modifier
5757 */
58- Optional <Function > function ();
58+ Optional <Function > damage ();
5959
6060 @ FunctionalInterface
6161 interface Function {
@@ -78,18 +78,6 @@ static Builder builder() {
7878 return Sponge .game ().builderProvider ().provide (Builder .class );
7979 }
8080
81- /**
82- * Creates a new {@link DamageModifier}.
83- *
84- * @param type The damage step type
85- * @param cause The modifier cause
86- * @param function The modifier function
87- * @return The new damage modifier
88- */
89- static DamageModifier of (DamageStepType type , Cause cause , Function function ) {
90- return DamageModifier .builder ().type (type ).cause (cause ).function (function ).build ();
91- }
92-
9381 /**
9482 * A builder to create {@link DamageModifier}s.
9583 */
@@ -104,19 +92,19 @@ interface Builder extends org.spongepowered.api.util.Builder<DamageModifier, Bui
10492 Builder type (DamageStepType type );
10593
10694 /**
107- * Sets the {@link Cause} for this modifier.
95+ * Sets the cause frame modifier.
10896 *
109- * @param cause The modifier cause
97+ * @param frameModifier The frame modifier
11098 * @return this builder for chaining
11199 */
112- Builder cause ( Cause cause );
100+ Builder frame ( Consumer < CauseStackManager . StackFrame > frameModifier );
113101
114102 /**
115103 * Sets the {@link Function} for this modifier.
116104 *
117- * @param function The modifier function
105+ * @param function The damage function
118106 * @return this builder for chaining
119107 */
120- Builder function (Function function );
108+ Builder damage (Function function );
121109 }
122110}
0 commit comments