Add EntityDeathEvent and implementations

This commit is contained in:
KingRainbow44
2022-07-24 13:20:42 -04:00
parent a13725b1cb
commit 886c2e2f43
7 changed files with 50 additions and 20 deletions

View File

@@ -0,0 +1,20 @@
package emu.grasscutter.server.event.entity;
import emu.grasscutter.game.entity.GameEntity;
import emu.grasscutter.server.event.types.EntityEvent;
import emu.grasscutter.utils.Location;
import lombok.Getter;
import javax.annotation.Nullable;
public final class EntityDeathEvent extends EntityEvent {
@Getter private final Location deathLocation;
@Getter @Nullable private final GameEntity killer;
public EntityDeathEvent(GameEntity entity, int killerId) {
super(entity);
this.deathLocation = new Location(entity.getScene(), entity.getPosition());
this.killer = entity.getScene().getEntityById(killerId);
}
}