use of org.spongepowered.api.event.entity.DestructEntityEvent in project LanternServer by LanternPowered.
the class LanternEntity method remove.
public void remove(RemoveState removeState) {
checkNotNull(removeState, "removeState");
if (this.removeState == removeState) {
return;
}
this.removeState = removeState;
if (removeState == RemoveState.DESTROYED) {
setVehicle(null);
clearPassengers();
// don't do it if the entity is dead.
if (!isDead()) {
setDead(true);
final CauseStack causeStack = CauseStack.current();
// TODO: Message channel?
final DestructEntityEvent event = SpongeEventFactory.createDestructEntityEvent(causeStack.getCurrentCause(), MessageChannel.TO_NONE, Optional.empty(), new MessageEvent.MessageFormatter(), this, false);
postDestructEvent(event);
}
}
}
Aggregations