Removed @deprecated classes, methods and properties, added some type hints

This commit is contained in:
Shoghi Cervantes
2015-09-12 17:10:11 +02:00
parent 29a5012c02
commit 3ffdb8e552
39 changed files with 166 additions and 891 deletions

View File

@ -19,6 +19,8 @@
*
*/
declare(strict_types=1);
namespace pocketmine\level;
use pocketmine\level\format\FullChunk;
@ -43,7 +45,7 @@ class SimpleChunkManager implements ChunkManager{
*
* @return int 0-255
*/
public function getBlockIdAt($x, $y, $z){
public function getBlockIdAt(int $x, int $y, int $z) : int{
if($chunk = $this->getChunk($x >> 4, $z >> 4)){
return $chunk->getBlockId($x & 0xf, $y & 0x7f, $z & 0xf);
}
@ -58,7 +60,7 @@ class SimpleChunkManager implements ChunkManager{
* @param int $z
* @param int $id 0-255
*/
public function setBlockIdAt($x, $y, $z, $id){
public function setBlockIdAt(int $x, int $y, int $z, int $id){
if($chunk = $this->getChunk($x >> 4, $z >> 4)){
$chunk->setBlockId($x & 0xf, $y & 0x7f, $z & 0xf, $id);
}
@ -73,7 +75,7 @@ class SimpleChunkManager implements ChunkManager{
*
* @return int 0-15
*/
public function getBlockDataAt($x, $y, $z){
public function getBlockDataAt(int $x, int $y, int $z) : int{
if($chunk = $this->getChunk($x >> 4, $z >> 4)){
return $chunk->getBlockData($x & 0xf, $y & 0x7f, $z & 0xf);
}
@ -88,7 +90,7 @@ class SimpleChunkManager implements ChunkManager{
* @param int $z
* @param int $data 0-15
*/
public function setBlockDataAt($x, $y, $z, $data){
public function setBlockDataAt(int $x, int $y, int $z, int $data){
if($chunk = $this->getChunk($x >> 4, $z >> 4)){
$chunk->setBlockData($x & 0xf, $y & 0x7f, $z & 0xf, $data);
}
@ -98,9 +100,9 @@ class SimpleChunkManager implements ChunkManager{
* @param int $chunkX
* @param int $chunkZ
*
* @return FullChunk
* @return FullChunk|null
*/
public function getChunk($chunkX, $chunkZ){
public function getChunk(int $chunkX, int $chunkZ){
return isset($this->chunks[$index = Level::chunkHash($chunkX, $chunkZ)]) ? $this->chunks[$index] : null;
}
@ -109,7 +111,7 @@ class SimpleChunkManager implements ChunkManager{
* @param int $chunkZ
* @param FullChunk $chunk
*/
public function setChunk($chunkX, $chunkZ, FullChunk $chunk = null){
public function setChunk(int $chunkX, int $chunkZ, FullChunk $chunk = null){
if($chunk === null){
unset($this->chunks[Level::chunkHash($chunkX, $chunkZ)]);
return;
@ -126,7 +128,7 @@ class SimpleChunkManager implements ChunkManager{
*
* @return int
*/
public function getSeed(){
public function getSeed() : int{
return $this->seed;
}
}