mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-19 16:59:37 +01:00
Fixed possible NPE when a projectile doesn't have a shooter
This commit is contained in:
parent
1cca4de9e5
commit
a1296596fa
@ -64,6 +64,11 @@ public class EntityListener implements Listener {
|
|||||||
|
|
||||||
if (attacker instanceof Projectile) {
|
if (attacker instanceof Projectile) {
|
||||||
attacker = ((Projectile) attacker).getShooter();
|
attacker = ((Projectile) attacker).getShooter();
|
||||||
|
|
||||||
|
//There is no shooter when a projectile is thrown by a dispenser
|
||||||
|
if (attacker == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (attacker instanceof Tameable) {
|
else if (attacker instanceof Tameable) {
|
||||||
AnimalTamer animalTamer = ((Tameable) attacker).getOwner();
|
AnimalTamer animalTamer = ((Tameable) attacker).getOwner();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user