Moved dimension id constants to their own interface (PHP needs enums)

This commit is contained in:
Dylan K. Taylor
2017-07-31 16:38:01 +01:00
parent 0b47324fe3
commit 306bf7be5f
3 changed files with 39 additions and 4 deletions

View File

@ -31,13 +31,15 @@ use pocketmine\network\mcpe\NetworkSession;
class ChangeDimensionPacket extends DataPacket{
const NETWORK_ID = ProtocolInfo::CHANGE_DIMENSION_PACKET;
const DIMENSION_OVERWORLD = 0;
const DIMENSION_NETHER = 1;
/** @var int */
public $dimension;
/** @var float */
public $x;
/** @var float */
public $y;
/** @var float */
public $z;
/** @var bool */
public $respawn = false;
public function decodePayload(){

View File

@ -0,0 +1,32 @@
<?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\network\mcpe\protocol\types;
interface DimensionIds{
const OVERWORLD = 0;
const NETHER = 1;
const THE_END = 2;
}