001 package org.bukkit.event.weather;
002
003 import org.bukkit.World;
004 import org.bukkit.entity.LightningStrike;
005 import org.bukkit.event.Cancellable;
006 import org.bukkit.event.HandlerList;
007
008 /**
009 * Stores data for lightning striking
010 */
011 public class LightningStrikeEvent extends WeatherEvent implements Cancellable {
012 private static final HandlerList handlers = new HandlerList();
013 private boolean canceled;
014 private final LightningStrike bolt;
015
016 public LightningStrikeEvent(final World world, final LightningStrike bolt) {
017 super(world);
018 this.bolt = bolt;
019 }
020
021 public boolean isCancelled() {
022 return canceled;
023 }
024
025 public void setCancelled(boolean cancel) {
026 canceled = cancel;
027 }
028
029 /**
030 * Gets the bolt which is striking the earth.
031 *
032 * @return lightning entity
033 */
034 public LightningStrike getLightning() {
035 return bolt;
036 }
037
038 @Override
039 public HandlerList getHandlers() {
040 return handlers;
041 }
042
043 public static HandlerList getHandlerList() {
044 return handlers;
045 }
046 }