Interface Explosion.Builder
-
- All Superinterfaces:
AbstractBuilder<Explosion>
,Buildable.Builder<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 forExplosion
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Explosion
build()
Attempts to create aExplosion
from the specified parameters.Explosion.Builder
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.Explosion.Builder
location(ServerLocation location)
Sets the location origin of the explosion.Explosion.Builder
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.Explosion.Builder
shouldBreakBlocks(boolean destroy)
Sets whether the affected blocks should be destroyed on explosion.Explosion.Builder
shouldDamageEntities(boolean damage)
Sets whether the explosion will damage entities nearby.Explosion.Builder
shouldPlaySmoke(boolean smoke)
Sets whether the explosion will have smoke particles.Explosion.Builder
sourceExplosive(@Nullable Explosive source)
Sets the source explosive of the explosion.-
Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
-
-
-
Method Detail
-
location
Explosion.Builder location(ServerLocation location)
Sets the location origin of the explosion.- Parameters:
location
- Origin of explosion- Returns:
- The builder, for chaining
-
sourceExplosive
Explosion.Builder sourceExplosive(@Nullable Explosive source)
Sets the source explosive of the explosion.- Parameters:
source
- The source entity- Returns:
- The builder, for chaining
-
radius
Explosion.Builder radius(float radius)
Sets the radius of the explosion.- Parameters:
radius
- The radius- Returns:
- The builder, for chaining
-
canCauseFire
Explosion.Builder canCauseFire(boolean fire)
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
Explosion.Builder shouldDamageEntities(boolean damage)
Sets whether the explosion will damage entities nearby.- Parameters:
damage
- Whether the explosion will damage entities- Returns:
- This builder, for chaining
-
shouldPlaySmoke
Explosion.Builder shouldPlaySmoke(boolean smoke)
Sets whether the explosion will have smoke particles.- Parameters:
smoke
- Whether the explosion will have smoke particles- Returns:
- This builder, for chaining
-
shouldBreakBlocks
Explosion.Builder shouldBreakBlocks(boolean destroy)
Sets whether the affected blocks should be destroyed on explosion.- Parameters:
destroy
- Whether the affected blocks should be destroyed- Returns:
- The builder, for chaining
-
resolution
default Explosion.Builder resolution(int resolution)
Sets the resolution of the explosion.- Parameters:
resolution
- The desired resolution of the explosion- Returns:
- The builder, for chaining
-
randomness
default Explosion.Builder randomness(float 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
default Explosion.Builder knockback(double 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
Explosion build() throws java.lang.IllegalArgumentException
Attempts to create aExplosion
from the specified parameters.- Specified by:
build
in interfaceAbstractBuilder<Explosion>
- Specified by:
build
in interfaceBuildable.Builder<Explosion>
- Returns:
- The explosion, if successful
- Throws:
java.lang.IllegalArgumentException
- If any builder parameter is invalid
-
-