SPIGOT-6726: NPE when calling getBossBar() on plugin spawned EnderDragon
This commit is contained in:
parent
5be41fb80f
commit
e167f28088
@ -67,12 +67,13 @@ public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderD
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BossBar getBossBar() {
|
public BossBar getBossBar() {
|
||||||
return getDragonBattle().getBossBar();
|
DragonBattle battle = getDragonBattle();
|
||||||
|
return battle != null ? battle.getBossBar() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DragonBattle getDragonBattle() {
|
public DragonBattle getDragonBattle() {
|
||||||
return new CraftDragonBattle(getHandle().getEnderDragonBattle());
|
return getHandle().getEnderDragonBattle() != null ? new CraftDragonBattle(getHandle().getEnderDragonBattle()) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user