mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-29 14:49:59 +00:00
Updated Vector-related classes
This commit is contained in:
parent
9859333aae
commit
abccfeac37
@ -665,11 +665,12 @@ abstract class Block extends Position{
|
||||
* Returns the Block on the side $side, works like Vector3::side()
|
||||
*
|
||||
* @param int $side
|
||||
* @param int $step
|
||||
*
|
||||
* @return Block
|
||||
*/
|
||||
public function getSide($side){
|
||||
$v = parent::getSide($side);
|
||||
public function getSide($side, $step = 1){
|
||||
$v = parent::getSide($side, $step);
|
||||
if($this->level instanceof Level){
|
||||
return $this->level->getBlock($v);
|
||||
}
|
||||
|
@ -48,12 +48,13 @@ class Position extends Vector3{
|
||||
/**
|
||||
* Returns a side Vector
|
||||
*
|
||||
* @param $side
|
||||
* @param int $side
|
||||
* @param int $step
|
||||
*
|
||||
* @return Position
|
||||
*/
|
||||
public function getSide($side){
|
||||
return Position::fromObject(parent::getSide($side), $this->level);
|
||||
public function getSide($side, $step = 1){
|
||||
return Position::fromObject(parent::getSide($side, $step), $this->level);
|
||||
}
|
||||
|
||||
/**
|
||||
|
0
src/pocketmine/level/format/ChunkSection.php
Normal file
0
src/pocketmine/level/format/ChunkSection.php
Normal file
0
src/pocketmine/level/format/anvil/RegionLoader.php
Normal file
0
src/pocketmine/level/format/anvil/RegionLoader.php
Normal file
0
src/pocketmine/level/format/generic/BaseChunk.php
Normal file
0
src/pocketmine/level/format/generic/BaseChunk.php
Normal file
67
src/pocketmine/level/format/generic/EmptyChunkSection.php
Normal file
67
src/pocketmine/level/format/generic/EmptyChunkSection.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?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/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\format;
|
||||
|
||||
/**
|
||||
* Stub used to detect empty chunks
|
||||
*/
|
||||
class EmptyChunkSection implements ChunkSection{
|
||||
final public function getBlockId($x, $y, $z){
|
||||
return 0;
|
||||
}
|
||||
|
||||
final public function getBlockIdColumn($x, $z){
|
||||
return "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
}
|
||||
|
||||
final public function getBlockDataColumn($x, $z){
|
||||
return "\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
}
|
||||
|
||||
final public function setBlockId($x, $y, $z, $id){
|
||||
|
||||
}
|
||||
|
||||
final public function getBlockData($x, $y, $z){
|
||||
return 0;
|
||||
}
|
||||
|
||||
final public function setBlockData($x, $y, $z, $data){
|
||||
|
||||
}
|
||||
|
||||
final public function getBlockLight($x, $y, $z){
|
||||
return 0;
|
||||
}
|
||||
|
||||
final public function setBlockLight($x, $y, $z, $level){
|
||||
|
||||
}
|
||||
|
||||
final public function getBlockSkyLight($x, $y, $z){
|
||||
return 0;
|
||||
}
|
||||
|
||||
final public function setBlockSkyLight($x, $y, $z, $level){
|
||||
|
||||
}
|
||||
}
|
22
src/pocketmine/level/format/pmf/ChunkSection.php
Normal file
22
src/pocketmine/level/format/pmf/ChunkSection.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?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/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace
|
Loading…
x
Reference in New Issue
Block a user