Interface ParticleEffect.Builder
-
- All Superinterfaces:
AbstractBuilder<ParticleEffect>
,Buildable.Builder<ParticleEffect>
,Builder<ParticleEffect,ParticleEffect.Builder>
,CopyableBuilder<ParticleEffect,ParticleEffect.Builder>
,DataBuilder<ParticleEffect>
,ResettableBuilder<ParticleEffect,ParticleEffect.Builder>
- Enclosing interface:
- ParticleEffect
public static interface ParticleEffect.Builder extends Builder<ParticleEffect,ParticleEffect.Builder>, CopyableBuilder<ParticleEffect,ParticleEffect.Builder>, DataBuilder<ParticleEffect>
Represents a builder to create aParticleEffect
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ParticleEffect
build()
Builds an instance of a ParticleEffect.default ParticleEffect.Builder
offset(Vector3d offset)
Sets the offset of the particle effect.default <V> ParticleEffect.Builder
option(Supplier<? extends ParticleOption<V>> option, V value)
Sets the value of the specifiedParticleOption
.<V> ParticleEffect.Builder
option(ParticleOption<V> option, V value)
Sets the value of the specifiedParticleOption
.default ParticleEffect.Builder
quantity(int quantity)
Sets the amount of particles of the particle effect.default <V> ParticleEffect.Builder
scale(Double scale)
Sets the scale of the particle effect.default ParticleEffect.Builder
type(Supplier<? extends ParticleType> particleType)
Sets the particle type for the particle effect.ParticleEffect.Builder
type(ParticleType particleType)
Sets the particle type for the particle effect.default ParticleEffect.Builder
velocity(Vector3d velocity)
Sets the velocity of the particle effect.-
Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
Methods inherited from interface org.spongepowered.api.data.persistence.DataBuilder
build
-
-
-
-
Method Detail
-
type
ParticleEffect.Builder type(ParticleType particleType)
Sets the particle type for the particle effect.- Parameters:
particleType
- The particle type- Returns:
- This builder for chaining
-
type
default ParticleEffect.Builder type(Supplier<? extends ParticleType> particleType)
Sets the particle type for the particle effect.- Parameters:
particleType
- The particle type- Returns:
- This builder for chaining
-
option
<V> ParticleEffect.Builder option(ParticleOption<V> option, V value) throws IllegalArgumentException
Sets the value of the specifiedParticleOption
.- Type Parameters:
V
- The type of option value- Parameters:
option
- The optionvalue
- The value- Returns:
- This builder for chaining
- Throws:
IllegalArgumentException
- If the specified value isn't valid
-
option
default <V> ParticleEffect.Builder option(Supplier<? extends ParticleOption<V>> option, V value) throws IllegalArgumentException
Sets the value of the specifiedParticleOption
.- Type Parameters:
V
- The type of option value- Parameters:
option
- The optionvalue
- The value- Returns:
- This builder for chaining
- Throws:
IllegalArgumentException
- If the specified value isn't valid
-
scale
default <V> ParticleEffect.Builder scale(Double scale)
Sets the scale of the particle effect.The default scale is 1.
- Parameters:
scale
- The scale- Returns:
- This builder for chaining
-
velocity
default ParticleEffect.Builder velocity(Vector3d velocity)
Sets the velocity of the particle effect.The default velocity is
Vector3d.ZERO
.- Parameters:
velocity
- The velocity- Returns:
- This builder for chaining
-
offset
default ParticleEffect.Builder offset(Vector3d offset)
Sets the offset of the particle effect.The default offset is
Vector3d.ZERO
.- Parameters:
offset
- The offset- Returns:
- This builder for chaining
-
quantity
default ParticleEffect.Builder quantity(int quantity) throws IllegalArgumentException
Sets the amount of particles of the particle effect.The default quantity is 1.
- Parameters:
quantity
- The quantity particles- Returns:
- This builder, for chaining
- Throws:
IllegalArgumentException
- If the quantity is less than one
-
build
ParticleEffect build()
Builds an instance of a ParticleEffect.- Specified by:
build
in interfaceAbstractBuilder<ParticleEffect>
- Specified by:
build
in interfaceBuildable.Builder<ParticleEffect>
- Returns:
- A new instance of a ParticleEffect
-
-