Files
Bukkit/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java
2011-05-15 14:06:02 +02:00

52 lines
1.3 KiB
Java

package org.bukkit.event.weather;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LightningStrike;
import org.bukkit.event.Cancellable;
/**
* Stores data for lightning striking
*/
public class LightningStrikeEvent extends WeatherEvent implements Cancellable {
private boolean canceled;
private LightningStrike bolt;
private World world;
public LightningStrikeEvent(World world, LightningStrike bolt) {
super(Type.LIGHTNING_STRIKE, world);
this.bolt = bolt;
this.world = world;
}
/**
* Gets the cancellation state of this event. A canceled event will not
* be executed in the server, but will still pass to other plugins
*
* @return true if this event is canceled
*/
public boolean isCancelled() {
return canceled;
}
/**
* Sets the cancellation state of this event. A canceled event will not
* be executed in the server, but will still pass to other plugins
*
* @param cancel true if you wish to cancel this event
*/
public void setCancelled(boolean cancel) {
canceled = cancel;
}
/**
* Gets the bolt which is striking the earth.
*
* @return lightning entity
*/
public LightningStrike getLightning() {
return bolt;
}
}