mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Add some constants to AnimatePacket
This commit is contained in:
parent
17be06a56d
commit
0b47324fe3
@ -1187,7 +1187,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
$pk = new AnimatePacket();
|
||||
$pk->entityRuntimeId = $this->id;
|
||||
$pk->action = 3; //Wake up
|
||||
$pk->action = AnimatePacket::ACTION_STOP_SLEEP;
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,10 @@ use pocketmine\Player;
|
||||
class PlayerAnimationEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @deprecated This is dependent on the protocol and should not be here.
|
||||
* Use the constants in {@link pocketmine\network\mcpe\protocol\AnimatePacket} instead.
|
||||
*/
|
||||
const ARM_SWING = 1;
|
||||
|
||||
/** @var int */
|
||||
|
@ -31,9 +31,14 @@ use pocketmine\network\mcpe\NetworkSession;
|
||||
class AnimatePacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::ANIMATE_PACKET;
|
||||
|
||||
const ACTION_SWING_ARM = 1;
|
||||
|
||||
const ACTION_STOP_SLEEP = 3;
|
||||
const ACTION_CRITICAL_HIT = 4;
|
||||
|
||||
public $action;
|
||||
public $entityRuntimeId;
|
||||
public $float; //TODO (Boat rowing time?)
|
||||
public $float = 0.0; //TODO (Boat rowing time?)
|
||||
|
||||
public function decodePayload(){
|
||||
$this->action = $this->getVarInt();
|
||||
|
Loading…
x
Reference in New Issue
Block a user