Skip to content

Commit

Permalink
Don't try to use the ScoreHud API if ScoreHud is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertzui123 committed May 8, 2022
1 parent cb3531c commit 61d098b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Wertzui123/BedrockClans/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public function onEnable(): void
$this->loadClans();
$this->prefix = (string)$this->getConfig()->get('prefix');
$this->getServer()->getPluginManager()->registerEvents(new EventListener($this), $this);
$this->getServer()->getPluginManager()->registerEvents(new ScoreHudListener($this), $this);
if ($this->getServer()->getPluginManager()->getPlugin('ScoreHud') !== null) {
$this->getServer()->getPluginManager()->registerEvents(new ScoreHudListener($this), $this);
}
$data = ['command' => $this->getConfig()->getNested('command.clan.command'), 'description' => $this->getConfig()->getNested('command.clan.description'), 'usage' => $this->getConfig()->getNested('command.clan.usage'), 'aliases' => $this->getConfig()->getNested('command.clan.aliases')];
$this->getServer()->getCommandMap()->register('BedrockClans', new ClanCommand($this, $data));
}
Expand Down

0 comments on commit 61d098b

Please sign in to comment.