mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-05 07:58:08 +01:00
Fix Nukkit related compilation issue
This commit is contained in:
parent
acd83a41c3
commit
7de29e72f9
@ -18,8 +18,8 @@ package com.djrapitops.plan.gathering.listeners.nukkit;
|
|||||||
|
|
||||||
import cn.nukkit.Player;
|
import cn.nukkit.Player;
|
||||||
import cn.nukkit.entity.Entity;
|
import cn.nukkit.entity.Entity;
|
||||||
|
import cn.nukkit.entity.EntityTameable;
|
||||||
import cn.nukkit.entity.item.EntityEndCrystal;
|
import cn.nukkit.entity.item.EntityEndCrystal;
|
||||||
import cn.nukkit.entity.passive.EntityTameable;
|
|
||||||
import cn.nukkit.entity.projectile.EntityProjectile;
|
import cn.nukkit.entity.projectile.EntityProjectile;
|
||||||
import cn.nukkit.event.EventHandler;
|
import cn.nukkit.event.EventHandler;
|
||||||
import cn.nukkit.event.EventPriority;
|
import cn.nukkit.event.EventPriority;
|
||||||
@ -131,13 +131,13 @@ public class DeathEventListener implements Listener {
|
|||||||
EntityDamageEvent entityDamageEvent = dead.getLastDamageCause();
|
EntityDamageEvent entityDamageEvent = dead.getLastDamageCause();
|
||||||
Entity killer = ((EntityDamageByEntityEvent) entityDamageEvent).getDamager();
|
Entity killer = ((EntityDamageByEntityEvent) entityDamageEvent).getDamager();
|
||||||
if (killer instanceof Player) return getItemInHand((Player) killer);
|
if (killer instanceof Player) return getItemInHand((Player) killer);
|
||||||
if (killer instanceof EntityTameable) return getPetType((EntityTameable) killer);
|
if (killer instanceof EntityTameable) return getPetType(killer);
|
||||||
|
|
||||||
// EntityProjectile, EntityEndCrystal and all other causes that are not known yet
|
// EntityProjectile, EntityEndCrystal and all other causes that are not known yet
|
||||||
return new EntityNameFormatter().apply(killer.getName());
|
return new EntityNameFormatter().apply(killer.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getPetType(EntityTameable tameable) {
|
private String getPetType(Entity tameable) {
|
||||||
return tameable.getName();
|
return tameable.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ public class DeathEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Optional<Player> getOwner(EntityTameable tameable) {
|
private Optional<Player> getOwner(EntityTameable tameable) {
|
||||||
if (!tameable.isTamed()) {
|
if (!tameable.hasOwner()) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user