mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
SPIGOT-6726: NPE when calling getBossBar() on plugin spawned EnderDragon
By: Brokkonaut <hannos17@gmx.de>
This commit is contained in:
parent
08e5ad2b2f
commit
1dfe698f4f
1 changed files with 3 additions and 2 deletions
|
@ -67,12 +67,13 @@ public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderD
|
|||
|
||||
@Override
|
||||
public BossBar getBossBar() {
|
||||
return getDragonBattle().getBossBar();
|
||||
DragonBattle battle = getDragonBattle();
|
||||
return battle != null ? battle.getBossBar() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DragonBattle getDragonBattle() {
|
||||
return new CraftDragonBattle(getHandle().getEnderDragonBattle());
|
||||
return getHandle().getEnderDragonBattle() != null ? new CraftDragonBattle(getHandle().getEnderDragonBattle()) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue