PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
EmptyChunkSection.php
1 <?php
2 
3 /*
4  *
5  * ____ _ _ __ __ _ __ __ ____
6  * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7  * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8  * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9  * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10  *
11  * This program is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * @author PocketMine Team
17  * @link http://www.pocketmine.net/
18  *
19  *
20 */
21 
22 namespace pocketmine\level\format\generic;
23 
26 
31 
32  private $y;
33 
34  public function __construct($y){
35  $this->y = $y;
36  }
37 
38  final public function getY(){
39  return $this->y;
40  }
41 
42  final public function getBlockId($x, $y, $z){
43  return 0;
44  }
45 
46  final public function getBlockIdColumn($x, $z){
47  return "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
48  }
49 
50  final public function getBlockDataColumn($x, $z){
51  return "\x00\x00\x00\x00\x00\x00\x00\x00";
52  }
53 
54  final public function getBlockSkyLightColumn($x, $z){
55  return "\xff\xff\xff\xff\xff\xff\xff\xff";
56  }
57 
58  final public function getBlockLightColumn($x, $z){
59  return "\x00\x00\x00\x00\x00\x00\x00\x00";
60  }
61 
62  final public function getFullBlock($x, $y, $z){
63  return 0;
64  }
65 
66  final public function getBlock($x, $y, $z, &$id = null, &$meta = null){
67  $id = 0;
68  $meta = 0;
69  }
70 
71  final public function setBlock($x, $y, $z, $id = null, $meta = null){
72  throw new ChunkException("Tried to modify an empty Chunk");
73  }
74 
75  public function getIdArray(){
76  return str_repeat("\x00", 4096);
77  }
78 
79  public function getDataArray(){
80  return str_repeat("\x00", 2048);
81  }
82 
83  public function getSkyLightArray(){
84  return str_repeat("\xff", 2048);
85  }
86 
87  public function getLightArray(){
88  return str_repeat("\x00", 2048);
89  }
90 
91  final public function setBlockId($x, $y, $z, $id){
92  throw new ChunkException("Tried to modify an empty Chunk");
93  }
94 
95  final public function getBlockData($x, $y, $z){
96  return 0;
97  }
98 
99  final public function setBlockData($x, $y, $z, $data){
100  throw new ChunkException("Tried to modify an empty Chunk");
101  }
102 
103  final public function getBlockLight($x, $y, $z){
104  return 0;
105  }
106 
107  final public function setBlockLight($x, $y, $z, $level){
108  throw new ChunkException("Tried to modify an empty Chunk");
109  }
110 
111  final public function getBlockSkyLight($x, $y, $z){
112  return 0;
113  }
114 
115  final public function setBlockSkyLight($x, $y, $z, $level){
116  throw new ChunkException("Tried to modify an empty Chunk");
117  }
118 }
getBlock($x, $y, $z, &$id=null, &$meta=null)