mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 21:37:39 +01:00
EntityCombustEvent
By: Taylor Kelly <tkelly910@gmail.com>
This commit is contained in:
parent
5c0413fb45
commit
02b2e4114c
@ -423,6 +423,13 @@ public abstract class Event {
|
|||||||
* @todo: add javadoc see comment
|
* @todo: add javadoc see comment
|
||||||
*/
|
*/
|
||||||
ENTITY_DEATH (Category.LIVING_ENTITY),
|
ENTITY_DEATH (Category.LIVING_ENTITY),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a Skeleton or Zombie catch fire due to the sun
|
||||||
|
*
|
||||||
|
* @todo: add javadoc see comment
|
||||||
|
*/
|
||||||
|
ENTITY_COMBUST (Category.LIVING_ENTITY),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VEHICLE EVENTS
|
* VEHICLE EVENTS
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package org.bukkit.event.entity;
|
||||||
|
|
||||||
|
import org.bukkit.Entity;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The event when a skeleton or zombie catch on fire due to the sun.
|
||||||
|
* If the event is cancelled, the fire is stopped.
|
||||||
|
*/
|
||||||
|
public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
||||||
|
private boolean cancel;
|
||||||
|
|
||||||
|
public EntityCombustEvent(Type type, Entity what) {
|
||||||
|
super(type, what);
|
||||||
|
this.cancel = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancel) {
|
||||||
|
this.cancel = cancel;
|
||||||
|
}
|
||||||
|
}
|
@ -14,4 +14,7 @@ public class EntityListener implements Listener {
|
|||||||
|
|
||||||
public void onEntityDamagedByEntity(EntityDamagedByEntityEvent event) {
|
public void onEntityDamagedByEntity(EntityDamagedByEntityEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onEntityCombust(EntityCombustEvent event) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import org.bukkit.event.CustomEventListener;
|
|||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.*;
|
import org.bukkit.event.block.*;
|
||||||
|
import org.bukkit.event.entity.EntityCombustEvent;
|
||||||
import org.bukkit.event.entity.EntityDamagedByBlockEvent;
|
import org.bukkit.event.entity.EntityDamagedByBlockEvent;
|
||||||
import org.bukkit.event.entity.EntityDamagedByEntityEvent;
|
import org.bukkit.event.entity.EntityDamagedByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityListener;
|
import org.bukkit.event.entity.EntityListener;
|
||||||
@ -179,6 +180,9 @@ public final class JavaPluginLoader implements PluginLoader {
|
|||||||
case ENTITY_DEATH:
|
case ENTITY_DEATH:
|
||||||
// TODO: ENTITY_DEATH hook
|
// TODO: ENTITY_DEATH hook
|
||||||
break;
|
break;
|
||||||
|
case ENTITY_COMBUST:
|
||||||
|
trueListener.onEntityCombust((EntityCombustEvent)event);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if (listener instanceof VehicleListener) {
|
} else if (listener instanceof VehicleListener) {
|
||||||
VehicleListener trueListener = (VehicleListener)listener;
|
VehicleListener trueListener = (VehicleListener)listener;
|
||||||
|
Loading…
Reference in New Issue
Block a user