Add PlayerJumpEvent (#1223)

This commit is contained in:
Taras 2017-07-22 13:18:53 +03:00 committed by Dylan K. Taylor
parent 6fa59230db
commit 6cacb368ce
2 changed files with 49 additions and 0 deletions

View File

@ -57,6 +57,7 @@ use pocketmine\event\player\PlayerGameModeChangeEvent;
use pocketmine\event\player\PlayerInteractEvent;
use pocketmine\event\player\PlayerItemConsumeEvent;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\event\player\PlayerJumpEvent;
use pocketmine\event\player\PlayerKickEvent;
use pocketmine\event\player\PlayerLoginEvent;
use pocketmine\event\player\PlayerMoveEvent;
@ -711,6 +712,11 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}
}
public function jump(){
$this->server->getPluginManager()->callEvent(new PlayerJumpEvent($this));
parent::jump();
}
/**
* Gets the player IP address
*

View File

@ -0,0 +1,43 @@
<?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);
namespace pocketmine\event\player;
use pocketmine\Player;
/**
* Called when a player jumps
*/
class PlayerJumpEvent extends PlayerEvent{
public static $handlerList = null;
/**
* PlayerJumpEvent constructor.
*
* @param Player $player
*/
public function __construct(Player $player){
$this->player = $player;
}
}