Skip to content

Commit 96cab76

Browse files
committed
今度こそ動くはず(pm5)
1 parent 3fc80cc commit 96cab76

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/Main.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
namespace NeiroNetwork\EvalBook;
66

77
use CortexPE\Commando\PacketHooker;
8-
use NeiroNetwork\EvalBook\command\EvalBookCommandPm4;
9-
use NeiroNetwork\EvalBook\command\EvalBookCommandPm5;
108
use NeiroNetwork\EvalBook\utils\CrashReportDisabler;
119
use NeiroNetwork\EvalBook\utils\CrashTracer;
1210
use NeiroNetwork\EvalBook\listener\BookEventListener;

src/command/EvalBookCommandPm5.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,28 @@
44

55
namespace NeiroNetwork\EvalBook\command;
66

7+
use CortexPE\Commando\BaseCommand;
8+
use NeiroNetwork\EvalBook\command\sub\CustomNameCommand;
9+
use NeiroNetwork\EvalBook\command\sub\NewCommand;
10+
use NeiroNetwork\EvalBook\command\sub\PermCommand;
11+
use NeiroNetwork\EvalBook\command\sub\ReloadCommand;
712
use NeiroNetwork\EvalBook\permission\EvalBookPermissionNames;
13+
use pocketmine\command\CommandSender;
814

9-
class EvalBookCommandPm5 extends EvalBookCommandPm4{
15+
class EvalBookCommandPm5 extends BaseCommand{
16+
17+
protected function prepare() : void{
18+
$this->setPermission(EvalBookPermissionNames::COMMAND);
19+
20+
$this->registerSubCommand(new ReloadCommand("reload", "Reload permitted operators configuration file"));
21+
$this->registerSubCommand(new NewCommand("new", "Get a new eval book", ["get", "give"]));
22+
$this->registerSubCommand(new PermCommand("perm", "Set the book's execution permission", ["permission"]));
23+
$this->registerSubCommand(new CustomNameCommand("customname", "Rename the book", ["name"]));
24+
}
25+
26+
public function onRun(CommandSender $sender, string $aliasUsed, array $args) : void{
27+
$this->sendUsage();
28+
}
1029

1130
// TODO: REMOVE THIS 💩 PATCH FOR PM5
1231
public function getPermission(){

0 commit comments

Comments
 (0)