Interface ParticleEffect.Builder
- All Superinterfaces:
AbstractBuilder<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 a
ParticleEffect
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds an instance of a ParticleEffect.default ParticleEffect.Builder
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
.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
Sets the scale of the particle effect.default ParticleEffect.Builder
type
(Supplier<? extends ParticleType> particleType) Sets the particle type for the particle effect.type
(ParticleType particleType) Sets the particle type for the particle effect.default ParticleEffect.Builder
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 Details
-
type
Sets the particle type for the particle effect.- Parameters:
particleType
- The particle type- Returns:
- This builder for chaining
-
type
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
Sets the scale of the particle effect.The default scale is 1.
- Parameters:
scale
- The scale- Returns:
- This builder for chaining
-
velocity
Sets the velocity of the particle effect.The default velocity is
Vector3d.ZERO
.- Parameters:
velocity
- The velocity- Returns:
- This builder for chaining
-
offset
Sets the offset of the particle effect.The default offset is
Vector3d.ZERO
.- Parameters:
offset
- The offset- Returns:
- This builder for chaining
-
quantity
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>
- Returns:
- A new instance of a ParticleEffect
-