mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Moved dimension id constants to their own interface (PHP needs enums)
This commit is contained in:
parent
0b47324fe3
commit
306bf7be5f
@ -155,6 +155,7 @@ use pocketmine\network\mcpe\protocol\TakeItemEntityPacket;
|
||||
use pocketmine\network\mcpe\protocol\TextPacket;
|
||||
use pocketmine\network\mcpe\protocol\TransferPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\ContainerIds;
|
||||
use pocketmine\network\mcpe\protocol\types\DimensionIds;
|
||||
use pocketmine\network\mcpe\protocol\UpdateAttributesPacket;
|
||||
use pocketmine\network\mcpe\protocol\UpdateBlockPacket;
|
||||
use pocketmine\network\mcpe\protocol\UseItemPacket;
|
||||
@ -1856,7 +1857,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->seed = -1;
|
||||
$pk->dimension = 0; //TODO: implement this properly
|
||||
$pk->dimension = DimensionIds::OVERWORLD; //TODO: implement this properly
|
||||
$pk->worldGamemode = Player::getClientFriendlyGamemode($this->server->getGamemode());
|
||||
$pk->difficulty = $this->server->getDifficulty();
|
||||
$pk->spawnX = $spawnPosition->getFloorX();
|
||||
|
@ -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(){
|
||||
|
32
src/pocketmine/network/mcpe/protocol/types/DimensionIds.php
Normal file
32
src/pocketmine/network/mcpe/protocol/types/DimensionIds.php
Normal 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;
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user