001    package org.bukkit.event.weather;
002    
003    import org.bukkit.World;
004    import org.bukkit.event.Cancellable;
005    import org.bukkit.event.HandlerList;
006    
007    /**
008     * Stores data for thunder state changing in a world
009     */
010    public class ThunderChangeEvent extends WeatherEvent implements Cancellable {
011        private static final HandlerList handlers = new HandlerList();
012        private boolean canceled;
013        private final boolean to;
014    
015        public ThunderChangeEvent(final World world, final boolean to) {
016            super(world);
017            this.to = to;
018        }
019    
020        public boolean isCancelled() {
021            return canceled;
022        }
023    
024        public void setCancelled(boolean cancel) {
025            canceled = cancel;
026        }
027    
028        /**
029         * Gets the state of thunder that the world is being set to
030         *
031         * @return true if the weather is being set to thundering, false otherwise
032         */
033        public boolean toThunderState() {
034            return to;
035        }
036    
037        @Override
038        public HandlerList getHandlers() {
039            return handlers;
040        }
041    
042        public static HandlerList getHandlerList() {
043            return handlers;
044        }
045    }