Added a lot of events relating to weather, including those for entities. Thanks wizjany!

This commit is contained in:
EvilSeph
2011-04-25 19:46:10 -04:00
parent a6c61782ac
commit b0e81bcc7b
10 changed files with 430 additions and 1 deletions

View File

@@ -0,0 +1,51 @@
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;
}
}