Skip to content

Commit

Permalink
home: add missing teleported message
Browse files Browse the repository at this point in the history
  • Loading branch information
Aericio committed Jul 16, 2023
1 parent 6aa1a05 commit ce6b0a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions resources/languages/english.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ commands:
command: "\n{GREEN}/f {COMMAND} - {RESET}{DESCRIPTION}"
home:
not-set: "{RED}Faction home is not set."
teleported: "{GREEN}You have teleported to your faction's home."
world-not-found: "{RED}World could not be found."
info:
message: "{GOLD}____________.[{DARK_GREEN}Faction {FACTION}{GOLD}].____________\n{GOLD}Description: {YELLOW}{DESCRIPTION}{RESET}\n{GOLD}Land / Power / Max Power: {YELLOW}{CLAIMS}/{POWER}/{TOTALPOWER}\n{GOLD}Age: {YELLOW}{AGE}\n{GOLD}Online: {YELLOW}{ONLINECOUNT}/{TOTALPLAYERS}\n{GOLD}Leader: {YELLOW}{LEADER}\n{GOLD}Relations: {RELATIONS}\n{GOLD}Members: {YELLOW}{PLAYERS}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ class HomeSubCommand extends FactionSubCommand
{
public function onNormalRun(Player $sender, ?Faction $faction, FactionsPlayer $member, string $aliasUsed, array $args): void
{
if (!$faction->getHomeWorld()) {
$member->sendMessage("commands.home.world-not-found");
return;
}
if (!($home = $faction->getHome())) {
$member->sendMessage("commands.home.not-set");
return;
}
if (!$faction->getHomeWorld()) {
$member->sendMessage("commands.home.world-not-found");
return;
}

$ev = new FactionHomeTeleportEvent($faction, $sender);
$ev->call();
if ($ev->isCancelled()) return;
$member->sendMessage("commands.home.teleported");
$sender->teleport($home);
}
}

0 comments on commit ce6b0a4

Please sign in to comment.