Interface Explosion.Builder
- All Superinterfaces:
AbstractBuilder<Explosion>
,Builder<Explosion,
,Explosion.Builder> CopyableBuilder<Explosion,
,Explosion.Builder> ResettableBuilder<Explosion,
Explosion.Builder>
- Enclosing interface:
Explosion
public static interface Explosion.Builder
extends Builder<Explosion,Explosion.Builder>, CopyableBuilder<Explosion,Explosion.Builder>
A builder for
Explosion
.-
Method Summary
Modifier and TypeMethodDescriptionblockInteraction
(ExplosionBlockInteraction interaction) Sets the desired block interaction.build()
Attempts to create aExplosion
from the specified parameters.canCauseFire
(boolean fire) Sets whether the affected blocks have a chance to catch on fire.default Explosion.Builder
knockback
(double knockback) Sets the relative strength of the knockback applied to nearby objects that can be knocked back.location
(ServerLocation location) Sets the location origin of the explosion.radius
(float radius) Sets the radius of the explosion.default Explosion.Builder
randomness
(float randomness) Indicates the desired randomness of the form of the explosion.default Explosion.Builder
resolution
(int resolution) Sets the resolution of the explosion.shouldDamageEntities
(boolean damage) Sets whether the explosion will damage entities nearby.shouldPlaySmoke
(boolean smoke) Sets whether the explosion will have smoke particles.sourceExplosive
(@Nullable Explosive source) Sets the source explosive of the explosion.Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
Method Details
-
location
Sets the location origin of the explosion.- Parameters:
location
- Origin of explosion- Returns:
- The builder, for chaining
-
sourceExplosive
Sets the source explosive of the explosion.- Parameters:
source
- The source entity- Returns:
- The builder, for chaining
-
radius
Sets the radius of the explosion.- Parameters:
radius
- The radius- Returns:
- The builder, for chaining
-
canCauseFire
Sets whether the affected blocks have a chance to catch on fire.- Parameters:
fire
- Whether the affected blocks can catch on fire- Returns:
- The builder, for chaining
-
shouldDamageEntities
Sets whether the explosion will damage entities nearby.- Parameters:
damage
- Whether the explosion will damage entities- Returns:
- This builder, for chaining
-
shouldPlaySmoke
Sets whether the explosion will have smoke particles.- Parameters:
smoke
- Whether the explosion will have smoke particles- Returns:
- This builder, for chaining
-
blockInteraction
Sets the desired block interaction.- Parameters:
interaction
- the desired block interaction- Returns:
- The builder, for chaining
-
resolution
Sets the resolution of the explosion.- Parameters:
resolution
- The desired resolution of the explosion- Returns:
- The builder, for chaining
-
randomness
Indicates the desired randomness of the form of the explosion.This value indicates how close to being symmetrical the explosion is. A value of zero indicates a completely symmetrical blast (in all three dimensions). A larger value indicates a lower likelihood of symmetry. A value of one indicates the platform default.
Note, this is a hint to the implementation. Implementations may not provide the means to produce semi-random form explosions.
- Parameters:
randomness
- The randomness- Returns:
- This builder, for chaining
-
knockback
Sets the relative strength of the knockback applied to nearby objects that can be knocked back.Note that the default behavior and strength is not defined here. A return value of 1 simply indicates the default behavior which is implementation dependent.
- Parameters:
knockback
- The knockback multiple- Returns:
- This builder, for chaining
-
build
Attempts to create aExplosion
from the specified parameters.- Specified by:
build
in interfaceAbstractBuilder<Explosion>
- Returns:
- The explosion, if successful
- Throws:
IllegalArgumentException
- If any builder parameter is invalid
-