Rename DataPacketPreReceiveEvent -> DataPacketDecodeEvent

thank you @IvanCraft623 for the suggestion
This commit is contained in:
Dylan K. Taylor 2023-03-16 13:40:37 +00:00
parent 941fd03998
commit ef45180b80
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ use pocketmine\network\mcpe\NetworkSession;
* Called before a packet is decoded and handled by the network session.
* Cancelling this event will drop the packet without decoding it, minimizing wasted CPU time.
*/
class DataPacketPreReceiveEvent extends ServerEvent implements Cancellable{
class DataPacketDecodeEvent extends ServerEvent implements Cancellable{
use CancellableTrait;
public function __construct(

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe;
use pocketmine\entity\effect\EffectInstance;
use pocketmine\event\player\PlayerDuplicateLoginEvent;
use pocketmine\event\server\DataPacketPreReceiveEvent;
use pocketmine\event\server\DataPacketDecodeEvent;
use pocketmine\event\server\DataPacketReceiveEvent;
use pocketmine\event\server\DataPacketSendEvent;
use pocketmine\form\Form;
@ -412,7 +412,7 @@ class NetworkSession{
$timings->startTiming();
try{
$ev = new DataPacketPreReceiveEvent($this, $packet->pid(), $buffer);
$ev = new DataPacketDecodeEvent($this, $packet->pid(), $buffer);
$ev->call();
if($ev->isCancelled()){
return;