-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to open the ui (/warpui, /worldui), cleanup start
- Loading branch information
Showing
11 changed files
with
202 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
warp-item: "compass" | ||
give-warp-item: true | ||
world-item: "clock" | ||
give-world-item: true | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace xenialdan\WarpUI; | ||
|
||
use pocketmine\command\CommandSender; | ||
use pocketmine\command\PluginCommand; | ||
use pocketmine\Player; | ||
use pocketmine\plugin\Plugin; | ||
use pocketmine\utils\TextFormat; | ||
|
||
class WorldUICommands extends PluginCommand | ||
{ | ||
|
||
public function __construct(Plugin $plugin) | ||
{ | ||
parent::__construct("worldui", $plugin); | ||
$this->setPermission("worldui.command"); | ||
$this->setDescription("The main commands for worldui"); | ||
} | ||
|
||
/** | ||
* @param CommandSender $sender | ||
* @param string $commandLabel | ||
* @param array $args | ||
* @return bool | ||
* @throws \InvalidArgumentException | ||
* @throws \InvalidStateException | ||
*/ | ||
public function execute(CommandSender $sender, string $commandLabel, array $args): bool | ||
{ | ||
if (!$sender instanceof Player) { | ||
$sender->sendMessage(TextFormat::RED . "This command must be run ingame"); | ||
return true; | ||
} | ||
if (!$sender->hasPermission($this->getPermission())) { | ||
$sender->sendMessage(TextFormat::RED . "No permission"); | ||
return true; | ||
} | ||
Loader::getInstance()->showWorldUI($sender); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.