Added EntityExplodeEvent :D
This commit is contained in:
parent
06d99445d9
commit
f4908db7c1
@ -445,6 +445,13 @@ public abstract class Event {
|
|||||||
* @todo: add javadoc see comment
|
* @todo: add javadoc see comment
|
||||||
*/
|
*/
|
||||||
ENTITY_COMBUST (Category.LIVING_ENTITY),
|
ENTITY_COMBUST (Category.LIVING_ENTITY),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity explodes, either TNT, Creeper, or Ghast Fireball
|
||||||
|
*
|
||||||
|
* @todo: add javadoc see comment
|
||||||
|
*/
|
||||||
|
ENTITY_EXPLODE (Category.LIVING_ENTITY),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VEHICLE EVENTS
|
* VEHICLE EVENTS
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
package org.bukkit.event.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author SpeaKeasY
|
||||||
|
*/
|
||||||
|
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
||||||
|
private boolean cancel;
|
||||||
|
private List blocks;
|
||||||
|
|
||||||
|
public EntityExplodeEvent (Type type, Entity what, List<Block> blocks) {
|
||||||
|
super(type.ENTITY_EXPLODE, what);
|
||||||
|
this.cancel = false;
|
||||||
|
this.blocks = blocks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCancelled(boolean cancel) {
|
||||||
|
this.cancel = cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the list of blocks that would have been removed or were
|
||||||
|
* removed from the explosion event.
|
||||||
|
*/
|
||||||
|
public List<Block> blockList() {
|
||||||
|
return blocks;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -23,4 +23,7 @@ public class EntityListener implements Listener {
|
|||||||
|
|
||||||
public void onEntityDamage(EntityDamageEvent event) {
|
public void onEntityDamage(EntityDamageEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onEntityExplode(EntityExplodeEvent event) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import org.bukkit.event.entity.EntityDamageByBlockEvent;
|
|||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.EntityListener;
|
import org.bukkit.event.entity.EntityListener;
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
import org.bukkit.event.server.PluginEvent;
|
import org.bukkit.event.server.PluginEvent;
|
||||||
@ -228,6 +229,9 @@ public final class JavaPluginLoader implements PluginLoader {
|
|||||||
case ENTITY_COMBUST:
|
case ENTITY_COMBUST:
|
||||||
trueListener.onEntityCombust((EntityCombustEvent)event);
|
trueListener.onEntityCombust((EntityCombustEvent)event);
|
||||||
break;
|
break;
|
||||||
|
case ENTITY_EXPLODE:
|
||||||
|
trueListener.onEntityExplode((EntityExplodeEvent)event);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if (listener instanceof VehicleListener) {
|
} else if (listener instanceof VehicleListener) {
|
||||||
VehicleListener trueListener = (VehicleListener)listener;
|
VehicleListener trueListener = (VehicleListener)listener;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user