Package dev.cwhead.GravesX.event
Class GravePreExplodeEvent
java.lang.Object
org.bukkit.event.Event
dev.cwhead.GravesX.event.graveevent.GraveEvent
dev.cwhead.GravesX.event.GravePreExplodeEvent
- All Implemented Interfaces:
Addon,org.bukkit.event.Cancellable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class dev.cwhead.GravesX.event.graveevent.GraveEvent
block, blockType, grave, location -
Constructor Summary
ConstructorsConstructorDescriptionGravePreExplodeEvent(@NotNull Grave grave, @NotNull org.bukkit.Location explosionLocation, @Nullable org.bukkit.entity.Entity source, float radius) Constructs a new GravePreExplosionEvent. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.LocationConvenience alias for readability – the explosion center.floatThe radius of the primed explosion.@Nullable org.bukkit.entity.EntityThe entity that is causing the explosion (TNT, Creeper, etc.), or null.@Nullable org.bukkit.entity.EntityTypeThe type of the source entity causing the explosion, or null if there is no source.@NotNull org.bukkit.WorldgetWorld()Gets the world of the explosion location.@Nullable org.bukkit.WorldGets the world of the explosion location, or null if not set.booleanhasWorld()Checks whether the explosion location has an associated world.voidsetExplosionLocation(@NotNull org.bukkit.Location location) Sets the explosion center location.voidsetRadius(float radius) Sets the radius of the primed explosion.voidsetSource(@Nullable org.bukkit.entity.Entity source) Sets the entity that is causing the explosion (TNT, Creeper, etc.), or null.voidsetWorld(@NotNull org.bukkit.World world) Sets the world of the explosion location while keeping its coordinates.Methods inherited from class dev.cwhead.GravesX.event.graveevent.GraveEvent
getBlock, getBlockExp, getBlockType, getGrave, getGraveExperience, getGraveOwnerDisplayName, getGraveOwnerName, getGraveOwnerNameDisplay, getGraveOwnerTexture, getGraveOwnerTextureSignature, getGraveOwnerUniqueId, getGraveUUID, getHandlerList, getHandlers, getLocation, hasBlock, hasBlockType, hasLocation, isAddon, isCancelled, isDropItems, setAddon, setBlockExp, setCancelled, setDropItems, setLocationMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
GravePreExplodeEvent
public GravePreExplodeEvent(@NotNull @NotNull Grave grave, @NotNull @NotNull org.bukkit.Location explosionLocation, @Nullable @Nullable org.bukkit.entity.Entity source, float radius) Constructs a new GravePreExplosionEvent.- Parameters:
grave- The grave that will be affected by the explosion.explosionLocation- The location where the explosion is primed to occur.source- The entity causing the explosion, may be null.radius- The radius of the primed explosion.
-
-
Method Details
-
getSource
@Nullable public @Nullable org.bukkit.entity.Entity getSource()The entity that is causing the explosion (TNT, Creeper, etc.), or null. -
setSource
public void setSource(@Nullable @Nullable org.bukkit.entity.Entity source) Sets the entity that is causing the explosion (TNT, Creeper, etc.), or null.- Parameters:
source- The new source entity, or null.
-
getSourceType
@Nullable public @Nullable org.bukkit.entity.EntityType getSourceType()The type of the source entity causing the explosion, or null if there is no source. -
getExplosionLocation
@NotNull public @NotNull org.bukkit.Location getExplosionLocation()Convenience alias for readability – the explosion center. -
setExplosionLocation
public void setExplosionLocation(@NotNull @NotNull org.bukkit.Location location) Sets the explosion center location.- Parameters:
location- The new explosion location.
-
getRadius
public float getRadius()The radius of the primed explosion. -
setRadius
public void setRadius(float radius) Sets the radius of the primed explosion.- Parameters:
radius- The new radius.
-
hasWorld
public boolean hasWorld()Checks whether the explosion location has an associated world.- Returns:
- true if the world is not null, false otherwise.
-
getWorld
@NotNull public @NotNull org.bukkit.World getWorld()Gets the world of the explosion location.- Returns:
- The world of the explosion.
- Throws:
GravesXNullPointerException- if the world is null.
-
getWorldNullable
@Nullable public @Nullable org.bukkit.World getWorldNullable()Gets the world of the explosion location, or null if not set.- Returns:
- The world of the explosion, or null.
-
setWorld
public void setWorld(@NotNull @NotNull org.bukkit.World world) Sets the world of the explosion location while keeping its coordinates.- Parameters:
world- The new world.
-