Files
Bukkit/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java

52 lines
1.2 KiB
Java

package org.bukkit.event.weather;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
/**
* Stores data for lightning striking
*/
public class LightningStrikeEvent extends WeatherEvent implements Cancellable {
private boolean canceled;
private Entity bolt;
private World world;
public LightningStrikeEvent(World world, Entity 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 Entity getLightning() {
return bolt;
}
}