Lootable EntityTypes are now accurate.

This commit is contained in:
Brianna 2020-08-31 10:55:42 -05:00
parent e43e805fe6
commit 8faec36f3c
1 changed files with 3 additions and 1 deletions

View File

@ -66,10 +66,12 @@ public class LootablesManager {
Entity killerEntity = null;
if (entity.getLastDamageCause() instanceof EntityDamageByEntityEvent) {
killerEntity = ((EntityDamageByEntityEvent) entity.getLastDamageCause()).getDamager();
killer = killerEntity.getType();
if (killerEntity instanceof Projectile) {
Projectile projectile = (Projectile) killerEntity;
if (projectile.getShooter() instanceof Entity) {
killer = ((Entity) projectile.getShooter()).getType();
killerEntity = ((Entity) projectile.getShooter());
killer = killerEntity.getType();
}
}
}