mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Added Event allocation pool, updated SPL with Class::onClassLoaded()
This commit is contained in:
@ -24,16 +24,27 @@
|
||||
*/
|
||||
namespace pocketmine\event;
|
||||
|
||||
use pocketmine\plugin\PluginManager;
|
||||
|
||||
abstract class Event{
|
||||
|
||||
/**
|
||||
* Any callable event must declare the static variable
|
||||
*
|
||||
* public static $handlerList = null;
|
||||
* public static $eventPool = [];
|
||||
* public static $nextEvent = 0;
|
||||
*
|
||||
* Not doing so will deny the proper event initialization
|
||||
*/
|
||||
|
||||
/** @var Event[] */
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Event[] */
|
||||
private static $knownEvents = [];
|
||||
|
||||
protected $eventName = null;
|
||||
private $isCancelled = false;
|
||||
|
||||
@ -41,7 +52,7 @@ abstract class Event{
|
||||
* @return string
|
||||
*/
|
||||
final public function getEventName(){
|
||||
return $this->eventName !== null ? get_class($this) : $this->eventName;
|
||||
return $this->eventName !== null ? static::class : $this->eventName;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,4 +96,40 @@ abstract class Event{
|
||||
return static::$handlerList;
|
||||
}
|
||||
|
||||
public static function clearEventPool(){
|
||||
static::$nextEvent = 0;
|
||||
}
|
||||
|
||||
public static function clearAllPools(){
|
||||
foreach(self::$knownEvents as $event){
|
||||
$event::clearEventPool();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $params
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function createEvent(...$params){
|
||||
if(static::$nextEvent >= count(static::$eventPool)){
|
||||
static::$eventPool[] = new static(...$params);
|
||||
return static::$eventPool[static::$nextEvent++];
|
||||
}
|
||||
$ev = static::$eventPool[static::$nextEvent++];
|
||||
$ev->__construct(...$params);
|
||||
if($ev instanceof Cancellable){
|
||||
$ev->setCancelled(false);
|
||||
}
|
||||
return $ev;
|
||||
}
|
||||
|
||||
public static function onClassLoaded(){
|
||||
self::$knownEvents[static::class] = static::class;
|
||||
}
|
||||
|
||||
public static function getKnownEvents(){
|
||||
return self::$knownEvents;
|
||||
}
|
||||
|
||||
}
|
@ -28,6 +28,8 @@ use pocketmine\Player;
|
||||
|
||||
class BlockBreakEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var \pocketmine\Player */
|
||||
protected $player;
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\event\Cancellable;
|
||||
|
||||
class BlockFormEvent extends BlockGrowEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
public function __construct(Block $block, Block $newState){
|
||||
parent::__construct($block, $newState);
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\event\Cancellable;
|
||||
|
||||
class BlockGrowEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Block */
|
||||
private $newState;
|
||||
|
@ -31,6 +31,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class BlockPlaceEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var \pocketmine\Player */
|
||||
protected $player;
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\event\Cancellable;
|
||||
|
||||
class BlockSpreadEvent extends BlockFormEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Block */
|
||||
private $source;
|
||||
|
@ -30,5 +30,7 @@ use pocketmine\Player;
|
||||
*/
|
||||
class BlockUpdateEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
}
|
@ -26,6 +26,8 @@ use pocketmine\event\Cancellable;
|
||||
|
||||
class LeavesDecayEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
public function __construct(Block $block){
|
||||
parent::__construct($block);
|
||||
|
@ -30,6 +30,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class SignChangeEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var \pocketmine\Player */
|
||||
private $player;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\item\Item;
|
||||
|
||||
class EntityArmorChangeEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $oldItem;
|
||||
private $newItem;
|
||||
|
@ -30,6 +30,8 @@ use pocketmine\event\Cancellable;
|
||||
*/
|
||||
class EntityBlockChangeEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $from;
|
||||
private $to;
|
||||
|
@ -25,6 +25,8 @@ use pocketmine\block\Block;
|
||||
use pocketmine\entity\Entity;
|
||||
|
||||
class EntityCombustByBlockEvent extends EntityCombustEvent{
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
protected $combuster;
|
||||
|
||||
|
@ -24,6 +24,8 @@ namespace pocketmine\event\entity;
|
||||
use pocketmine\entity\Entity;
|
||||
|
||||
class EntityCombustByEntityEvent extends EntityCombustEvent{
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
protected $combuster;
|
||||
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\event\Cancellable;
|
||||
|
||||
class EntityCombustEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
protected $duration;
|
||||
|
||||
|
@ -25,6 +25,8 @@ use pocketmine\block\Block;
|
||||
use pocketmine\entity\Entity;
|
||||
|
||||
class EntityDamageByBlockEvent extends EntityDamageEvent{
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Block */
|
||||
private $damager;
|
||||
|
@ -24,6 +24,8 @@ namespace pocketmine\event\entity;
|
||||
use pocketmine\entity\Entity;
|
||||
|
||||
class EntityDamageByEntityEvent extends EntityDamageEvent{
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Entity */
|
||||
private $damager;
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\event\Cancellable;
|
||||
|
||||
class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
const MODIFIER_BASE = 0;
|
||||
const MODIFIER_ARMOR = 1;
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\item\Item;
|
||||
|
||||
class EntityDeathEvent extends EntityEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Item[] */
|
||||
private $drops = [];
|
||||
|
@ -33,6 +33,8 @@ use pocketmine\entity\Vehicle;
|
||||
*/
|
||||
class EntityDespawnEvent extends EntityEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $entityType;
|
||||
|
||||
|
@ -31,6 +31,8 @@ use pocketmine\level\Position;
|
||||
*/
|
||||
class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Position */
|
||||
protected $position;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\item\Item;
|
||||
|
||||
class EntityInventoryChangeEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $oldItem;
|
||||
private $newItem;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\level\Level;
|
||||
|
||||
class EntityLevelChangeEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $originLevel;
|
||||
private $targetLevel;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class EntityMotionEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $mot;
|
||||
|
||||
|
@ -31,6 +31,8 @@ use pocketmine\math\Vector3;
|
||||
*/
|
||||
class EntityMoveEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var \pocketmine\math\Vector3 */
|
||||
private $pos;
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\event\Cancellable;
|
||||
|
||||
class EntityRegainHealthEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
const CAUSE_REGEN = 0;
|
||||
const CAUSE_EATING = 1;
|
||||
|
@ -29,6 +29,8 @@ use pocketmine\item\Item;
|
||||
|
||||
class EntityShootBowEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Item */
|
||||
private $bow;
|
||||
|
@ -33,6 +33,8 @@ use pocketmine\entity\Vehicle;
|
||||
*/
|
||||
class EntitySpawnEvent extends EntityEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $entityType;
|
||||
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\level\Position;
|
||||
|
||||
class EntityTeleportEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Position */
|
||||
private $from;
|
||||
|
@ -29,6 +29,8 @@ use pocketmine\event\Cancellable;
|
||||
*/
|
||||
class ExplosionPrimeEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
protected $force;
|
||||
private $blockBreaking;
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\event\Cancellable;
|
||||
|
||||
class ItemDespawnEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @param DroppedItem $item
|
||||
|
@ -25,6 +25,8 @@ use pocketmine\entity\DroppedItem;
|
||||
|
||||
class ItemSpawnEvent extends EntityEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @param DroppedItem $item
|
||||
|
@ -25,6 +25,8 @@ use pocketmine\entity\Projectile;
|
||||
|
||||
class ProjectileHitEvent extends EntityEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @param Projectile $entity
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\event\Cancellable;
|
||||
|
||||
class ProjectileLaunchEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @param Projectile $entity
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\inventory\Recipe;
|
||||
|
||||
class CraftItemEvent extends Event implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var CraftingTransactionGroup */
|
||||
private $ts;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\tile\Furnace;
|
||||
|
||||
class FurnaceBurnEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $furnace;
|
||||
private $fuel;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\tile\Furnace;
|
||||
|
||||
class FurnaceSmeltEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $furnace;
|
||||
private $source;
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\Player;
|
||||
|
||||
class InventoryCloseEvent extends InventoryEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Player */
|
||||
private $who;
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\Player;
|
||||
|
||||
class InventoryOpenEvent extends InventoryEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Player */
|
||||
private $who;
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\item\Item;
|
||||
|
||||
class InventoryPickupItemEvent extends InventoryEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Item */
|
||||
private $item;
|
||||
|
@ -31,6 +31,8 @@ use pocketmine\inventory\TransactionGroup;
|
||||
*/
|
||||
class InventoryTransactionEvent extends Event implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var TransactionGroup */
|
||||
private $ts;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\level\format\FullChunk;
|
||||
*/
|
||||
class ChunkLoadEvent extends ChunkEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $newChunk;
|
||||
|
||||
|
@ -26,4 +26,6 @@ namespace pocketmine\event\level;
|
||||
*/
|
||||
class ChunkPopulateEvent extends ChunkEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
}
|
@ -28,4 +28,6 @@ use pocketmine\event\Cancellable;
|
||||
*/
|
||||
class ChunkUnloadEvent extends ChunkEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
}
|
@ -26,4 +26,6 @@ namespace pocketmine\event\level;
|
||||
*/
|
||||
class LevelInitEvent extends LevelEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
}
|
@ -26,4 +26,6 @@ namespace pocketmine\event\level;
|
||||
*/
|
||||
class LevelLoadEvent extends LevelEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
}
|
@ -26,4 +26,6 @@ namespace pocketmine\event\level;
|
||||
*/
|
||||
class LevelSaveEvent extends LevelEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
}
|
@ -28,4 +28,6 @@ use pocketmine\event\Cancellable;
|
||||
*/
|
||||
class LevelUnloadEvent extends LevelEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
}
|
@ -30,6 +30,8 @@ use pocketmine\level\Position;
|
||||
*/
|
||||
class SpawnChangeEvent extends LevelEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Position */
|
||||
private $previousSpawn;
|
||||
|
@ -29,6 +29,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerAchievementAwardedEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $achievement;
|
||||
|
@ -29,6 +29,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerAnimationEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
const ARM_SWING = 1;
|
||||
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\Player;
|
||||
|
||||
class PlayerBedEnterEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $bed;
|
||||
|
||||
|
@ -26,6 +26,8 @@ use pocketmine\Player;
|
||||
|
||||
class PlayerBedLeaveEvent extends PlayerEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $bed;
|
||||
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\Player;
|
||||
|
||||
class PlayerBucketEmptyEvent extends PlayerBucketEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
public function __construct(Player $who, Block $blockClicked, $blockFace, Item $bucket, Item $itemInHand){
|
||||
parent::__construct($who, $blockClicked, $blockFace, $bucket, $itemInHand);
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\Player;
|
||||
|
||||
class PlayerBucketFillEvent extends PlayerBucketEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
public function __construct(Player $who, Block $blockClicked, $blockFace, Item $bucket, Item $itemInHand){
|
||||
parent::__construct($who, $blockClicked, $blockFace, $bucket, $itemInHand);
|
||||
|
@ -30,6 +30,8 @@ use pocketmine\Server;
|
||||
*/
|
||||
class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $message;
|
||||
|
@ -34,6 +34,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $message;
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\Player;
|
||||
|
||||
class PlayerDeathEvent extends EntityDeathEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $deathMessage;
|
||||
private $keepInventory = false;
|
||||
|
@ -30,6 +30,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerDropItemEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Item */
|
||||
private $drop;
|
||||
|
@ -29,6 +29,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var int */
|
||||
protected $gamemode;
|
||||
|
@ -31,6 +31,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerInteractEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @var \pocketmine\block\Block;
|
||||
|
@ -30,6 +30,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Item */
|
||||
private $item;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\Player;
|
||||
|
||||
class PlayerItemHeldEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $item;
|
||||
private $slot;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerJoinEvent extends PlayerEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $joinMessage;
|
||||
|
@ -29,6 +29,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerKickEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $quitMessage;
|
||||
|
@ -29,6 +29,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerLoginEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $kickMessage;
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\Player;
|
||||
|
||||
class PlayerMoveEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $from;
|
||||
private $to;
|
||||
|
@ -29,6 +29,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerPreLoginEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $kickMessage;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerQuitEvent extends PlayerEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $quitMessage;
|
||||
|
@ -29,6 +29,8 @@ use pocketmine\Player;
|
||||
*/
|
||||
class PlayerRespawnEvent extends PlayerEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var Position */
|
||||
protected $position;
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\plugin\Plugin;
|
||||
|
||||
class PluginDisableEvent extends PluginEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @param Plugin $plugin
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\plugin\Plugin;
|
||||
|
||||
class PluginEnableEvent extends PluginEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @param Plugin $plugin
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\Player;
|
||||
|
||||
class DataPacketReceiveEvent extends ServerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $packet;
|
||||
private $player;
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\Player;
|
||||
|
||||
class DataPacketSendEvent extends ServerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
private $packet;
|
||||
private $player;
|
||||
|
@ -27,6 +27,8 @@ use pocketmine\utils\Binary;
|
||||
|
||||
class QueryRegenerateEvent extends ServerEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
const GAME_ID = "MINECRAFTPE";
|
||||
|
||||
|
@ -28,6 +28,8 @@ use pocketmine\command\CommandSender;
|
||||
*/
|
||||
class RemoteServerCommandEvent extends ServerCommandEvent{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @param CommandSender $sender
|
||||
|
@ -34,6 +34,8 @@ use pocketmine\event\Cancellable;
|
||||
*/
|
||||
class ServerCommandEvent extends ServerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
public static $eventPool = [];
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $command;
|
||||
|
Reference in New Issue
Block a user