Class DamageModifier.Builder
- java.lang.Object
-
- org.spongepowered.api.event.cause.entity.damage.DamageModifier.Builder
-
- All Implemented Interfaces:
AbstractBuilder<DamageModifier>
,Buildable.Builder<DamageModifier>
,Builder<DamageModifier,DamageModifier.Builder>
,CopyableBuilder<DamageModifier,DamageModifier.Builder>
,ResettableBuilder<DamageModifier,DamageModifier.Builder>
- Enclosing interface:
- DamageModifier
public static final class DamageModifier.Builder extends java.lang.Object implements Builder<DamageModifier,DamageModifier.Builder>, CopyableBuilder<DamageModifier,DamageModifier.Builder>
A builder that createsDamageModifier
s, for use in both plugin and implementation requirements.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DamageModifier
build()
DamageModifier.Builder
cause(Cause cause)
Sets theCause
for theDamageModifier
to build.DamageModifier.Builder
from(DamageModifier value)
Resets this builder to the values of the given built object.DamageModifier.Builder
item(ItemStack itemStack)
DamageModifier.Builder
item(ItemStackSnapshot snapshot)
DamageModifier.Builder
reset()
Resets this builder to a "default" state such that there is no remaining data to set.DamageModifier.Builder
type(java.util.function.Supplier<? extends DamageModifierType> damageModifierType)
Sets theDamageModifierType
for theDamageModifier
to build.DamageModifier.Builder
type(DamageModifierType damageModifierType)
Sets theDamageModifierType
for theDamageModifier
to build.
-
-
-
Method Detail
-
type
public DamageModifier.Builder type(java.util.function.Supplier<? extends DamageModifierType> damageModifierType)
Sets theDamageModifierType
for theDamageModifier
to build.- Parameters:
damageModifierType
- The damage modifier type- Returns:
- This builder, for chaining
-
type
public DamageModifier.Builder type(DamageModifierType damageModifierType)
Sets theDamageModifierType
for theDamageModifier
to build.- Parameters:
damageModifierType
- The damage modifier type- Returns:
- This builder, for chaining
-
item
public DamageModifier.Builder item(ItemStack itemStack)
-
item
public DamageModifier.Builder item(ItemStackSnapshot snapshot)
-
cause
public DamageModifier.Builder cause(Cause cause)
Sets theCause
for theDamageModifier
to build.- Parameters:
cause
- The cause for the damage modifier- Returns:
- This builder, for chaining
-
build
public DamageModifier build()
- Specified by:
build
in interfaceAbstractBuilder<DamageModifier>
- Specified by:
build
in interfaceBuildable.Builder<DamageModifier>
- Returns:
- The newly created damage modifier
-
from
public DamageModifier.Builder from(DamageModifier value)
Description copied from interface:CopyableBuilder
Resets this builder to the values of the given built object.- Specified by:
from
in interfaceCopyableBuilder<DamageModifier,DamageModifier.Builder>
- Parameters:
value
- The built object- Returns:
- This builder, for chaining
-
reset
public DamageModifier.Builder reset()
Description copied from interface:Builder
Resets this builder to a "default" state such that there is no remaining data to set. This is to be the presumed "default" state.- Specified by:
reset
in interfaceBuilder<DamageModifier,DamageModifier.Builder>
- Specified by:
reset
in interfaceResettableBuilder<DamageModifier,DamageModifier.Builder>
- Returns:
- This builder, for chaining
-
-