mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 00:29:54 +00:00
Add PlayerJumpEvent (#1223)
This commit is contained in:
parent
6fa59230db
commit
6cacb368ce
@ -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
|
||||
*
|
||||
|
43
src/pocketmine/event/player/PlayerJumpEvent.php
Normal file
43
src/pocketmine/event/player/PlayerJumpEvent.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user