Remove ServerEvent class (#6695)

This commit is contained in:
zSALLAZAR 2025-05-14 08:06:22 +02:00 committed by GitHub
parent 88cdc2eb67
commit bb7bfee0cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 16 additions and 41 deletions

View File

@ -26,6 +26,7 @@ namespace pocketmine\event\server;
use pocketmine\command\CommandSender; use pocketmine\command\CommandSender;
use pocketmine\event\Cancellable; use pocketmine\event\Cancellable;
use pocketmine\event\CancellableTrait; use pocketmine\event\CancellableTrait;
use pocketmine\event\Event;
/** /**
* Called when any CommandSender runs a command, before it is parsed. * Called when any CommandSender runs a command, before it is parsed.
@ -41,7 +42,7 @@ use pocketmine\event\CancellableTrait;
* *
* The message DOES NOT begin with a slash. * The message DOES NOT begin with a slash.
*/ */
class CommandEvent extends ServerEvent implements Cancellable{ class CommandEvent extends Event implements Cancellable{
use CancellableTrait; use CancellableTrait;
public function __construct( public function __construct(

View File

@ -25,13 +25,14 @@ namespace pocketmine\event\server;
use pocketmine\event\Cancellable; use pocketmine\event\Cancellable;
use pocketmine\event\CancellableTrait; use pocketmine\event\CancellableTrait;
use pocketmine\event\Event;
use pocketmine\network\mcpe\NetworkSession; use pocketmine\network\mcpe\NetworkSession;
/** /**
* Called before a packet is decoded and handled by the network session. * 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. * Cancelling this event will drop the packet without decoding it, minimizing wasted CPU time.
*/ */
class DataPacketDecodeEvent extends ServerEvent implements Cancellable{ class DataPacketDecodeEvent extends Event implements Cancellable{
use CancellableTrait; use CancellableTrait;
public function __construct( public function __construct(

View File

@ -25,10 +25,11 @@ namespace pocketmine\event\server;
use pocketmine\event\Cancellable; use pocketmine\event\Cancellable;
use pocketmine\event\CancellableTrait; use pocketmine\event\CancellableTrait;
use pocketmine\event\Event;
use pocketmine\network\mcpe\NetworkSession; use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\protocol\ServerboundPacket; use pocketmine\network\mcpe\protocol\ServerboundPacket;
class DataPacketReceiveEvent extends ServerEvent implements Cancellable{ class DataPacketReceiveEvent extends Event implements Cancellable{
use CancellableTrait; use CancellableTrait;
public function __construct( public function __construct(

View File

@ -25,6 +25,7 @@ namespace pocketmine\event\server;
use pocketmine\event\Cancellable; use pocketmine\event\Cancellable;
use pocketmine\event\CancellableTrait; use pocketmine\event\CancellableTrait;
use pocketmine\event\Event;
use pocketmine\network\mcpe\NetworkSession; use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\protocol\ClientboundPacket; use pocketmine\network\mcpe\protocol\ClientboundPacket;
use pocketmine\utils\Utils; use pocketmine\utils\Utils;
@ -32,7 +33,7 @@ use pocketmine\utils\Utils;
/** /**
* Called when packets are sent to network sessions. * Called when packets are sent to network sessions.
*/ */
class DataPacketSendEvent extends ServerEvent implements Cancellable{ class DataPacketSendEvent extends Event implements Cancellable{
use CancellableTrait; use CancellableTrait;
/** /**

View File

@ -23,13 +23,14 @@ declare(strict_types=1);
namespace pocketmine\event\server; namespace pocketmine\event\server;
use pocketmine\event\Event;
use pocketmine\utils\Process; use pocketmine\utils\Process;
/** /**
* Called when the server is in a low-memory state as defined by the properties * Called when the server is in a low-memory state as defined by the properties
* Plugins should free caches or other non-essential data. * Plugins should free caches or other non-essential data.
*/ */
class LowMemoryEvent extends ServerEvent{ class LowMemoryEvent extends Event{
public function __construct( public function __construct(
private int $memory, private int $memory,
private int $memoryLimit, private int $memoryLimit,

View File

@ -23,9 +23,10 @@ declare(strict_types=1);
namespace pocketmine\event\server; namespace pocketmine\event\server;
use pocketmine\event\Event;
use pocketmine\network\NetworkInterface; use pocketmine\network\NetworkInterface;
class NetworkInterfaceEvent extends ServerEvent{ class NetworkInterfaceEvent extends Event{
public function __construct( public function __construct(
protected NetworkInterface $interface protected NetworkInterface $interface
){} ){}

View File

@ -23,9 +23,10 @@ declare(strict_types=1);
namespace pocketmine\event\server; namespace pocketmine\event\server;
use pocketmine\event\Event;
use pocketmine\network\query\QueryInfo; use pocketmine\network\query\QueryInfo;
class QueryRegenerateEvent extends ServerEvent{ class QueryRegenerateEvent extends Event{
public function __construct(private QueryInfo $queryInfo){} public function __construct(private QueryInfo $queryInfo){}
public function getQueryInfo() : QueryInfo{ public function getQueryInfo() : QueryInfo{

View File

@ -1,33 +0,0 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
/**
* Events related to the server core, like networking, stop, console commands
*/
namespace pocketmine\event\server;
use pocketmine\event\Event;
abstract class ServerEvent extends Event{
}

View File

@ -23,13 +23,14 @@ declare(strict_types=1);
namespace pocketmine\event\server; namespace pocketmine\event\server;
use pocketmine\event\Event;
use pocketmine\updater\UpdateChecker; use pocketmine\updater\UpdateChecker;
/** /**
* Called when the update checker receives notification of an available PocketMine-MP update. * Called when the update checker receives notification of an available PocketMine-MP update.
* Plugins may use this event to perform actions when an update notification is received. * Plugins may use this event to perform actions when an update notification is received.
*/ */
class UpdateNotifyEvent extends ServerEvent{ class UpdateNotifyEvent extends Event{
public function __construct(private UpdateChecker $updater){} public function __construct(private UpdateChecker $updater){}
public function getUpdater() : UpdateChecker{ public function getUpdater() : UpdateChecker{