diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 18cd70b4e..a6dc52962 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -42,7 +42,6 @@ use pocketmine\event\player\PlayerDataSaveEvent; use pocketmine\event\server\CommandEvent; use pocketmine\event\server\DataPacketBroadcastEvent; use pocketmine\event\server\QueryRegenerateEvent; -use pocketmine\event\server\ServerCommandEvent; use pocketmine\inventory\CraftingManager; use pocketmine\item\enchantment\Enchantment; use pocketmine\item\Item; @@ -1979,10 +1978,7 @@ class Server{ public function checkConsole(){ Timings::$serverCommandTimer->startTiming(); while(($line = $this->console->getLine()) !== null){ - $this->pluginManager->callEvent($ev = new ServerCommandEvent($this->consoleSender, $line)); - if(!$ev->isCancelled()){ - $this->dispatchCommand($ev->getSender(), $ev->getCommand()); - } + $this->dispatchCommand($this->consoleSender, $line); } Timings::$serverCommandTimer->stopTiming(); } diff --git a/src/pocketmine/event/server/RemoteServerCommandEvent.php b/src/pocketmine/event/server/RemoteServerCommandEvent.php deleted file mode 100644 index 9b1039104..000000000 --- a/src/pocketmine/event/server/RemoteServerCommandEvent.php +++ /dev/null @@ -1,42 +0,0 @@ -sender = $sender; - $this->command = $command; - } - - /** - * @return CommandSender - */ - public function getSender() : CommandSender{ - return $this->sender; - } - - /** - * @return string - */ - public function getCommand() : string{ - return $this->command; - } - - /** - * @param string $command - */ - public function setCommand(string $command) : void{ - $this->command = $command; - } -} diff --git a/src/pocketmine/network/rcon/RCON.php b/src/pocketmine/network/rcon/RCON.php index cf57cd106..919f8bfe9 100644 --- a/src/pocketmine/network/rcon/RCON.php +++ b/src/pocketmine/network/rcon/RCON.php @@ -28,7 +28,6 @@ declare(strict_types=1); namespace pocketmine\network\rcon; use pocketmine\command\RemoteConsoleCommandSender; -use pocketmine\event\server\RemoteServerCommandEvent; use pocketmine\Server; use pocketmine\snooze\SleeperNotifier; use pocketmine\utils\TextFormat; @@ -95,13 +94,7 @@ class RCON{ public function check() : void{ $response = new RemoteConsoleCommandSender(); - $command = $this->instance->cmd; - - $this->server->getPluginManager()->callEvent($ev = new RemoteServerCommandEvent($response, $command)); - - if(!$ev->isCancelled()){ - $this->server->dispatchCommand($ev->getSender(), $ev->getCommand()); - } + $this->server->dispatchCommand($response, $this->instance->cmd); $this->instance->response = TextFormat::clean($response->getMessage()); $this->instance->synchronized(function(RCONInstance $thread){