oops, remove test code

This commit is contained in:
ShockedPlot7560 2023-10-22 15:05:06 +02:00
parent 7a4b9a0367
commit 9b2b92ac1f
No known key found for this signature in database
GPG Key ID: D7539B420F1FA86E
2 changed files with 5 additions and 11 deletions

View File

@ -24,8 +24,6 @@ declare(strict_types=1);
namespace pocketmine\event\player;
use pocketmine\command\CommandSender;
use pocketmine\event\AsyncEvent;
use pocketmine\event\AsyncEventTrait;
use pocketmine\event\Cancellable;
use pocketmine\event\CancellableTrait;
use pocketmine\player\chat\ChatFormatter;
@ -35,9 +33,8 @@ use pocketmine\utils\Utils;
/**
* Called when a player chats something
*/
class PlayerChatEvent extends PlayerEvent implements Cancellable, AsyncEvent{
class PlayerChatEvent extends PlayerEvent implements Cancellable{
use CancellableTrait;
use AsyncEventTrait;
/**
* @param CommandSender[] $recipients

View File

@ -1513,13 +1513,10 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
Timings::$playerCommand->stopTiming();
}else{
$ev = new PlayerChatEvent($this, $messagePart, $this->server->getBroadcastChannelSubscribers(Server::BROADCAST_CHANNEL_USERS), new StandardChatFormatter());
$ev->callAsync()
->onCompletion(function() use ($ev) {
$ev->call();
if(!$ev->isCancelled()){
$this->server->broadcastMessage($ev->getFormatter()->format($ev->getPlayer()->getDisplayName(), $ev->getMessage()), $ev->getRecipients());
}
}, function (){
});
}
}