|
| getSaveId () |
|
| __construct (Level $level, CompoundTag $nbt) |
|
| getId () |
|
| saveNBT () |
|
| getBlock () |
|
| onUpdate () |
|
| scheduleUpdate () |
|
| __destruct () |
|
| close () |
|
| getName () |
|
| __construct ($x=0, $y=0, $z=0, Level $level=null) |
|
| asPosition () |
|
| add ($x, $y=0, $z=0) |
|
| getLevel () |
|
| setLevel (Level $level=null) |
|
| isValid () |
|
| getSide ($side, $step=1) |
|
| __toString () |
|
| setComponents ($x, $y, $z) |
|
| fromObjectAdd (Vector3 $pos, $x, $y, $z) |
|
| __construct ($x=0, $y=0, $z=0) |
|
| getX () |
|
| getY () |
|
| getZ () |
|
| getFloorX () |
|
| getFloorY () |
|
| getFloorZ () |
|
| getRight () |
|
| getUp () |
|
| getForward () |
|
| getSouth () |
|
| getWest () |
|
| add ($x, $y=0, $z=0) |
|
| subtract ($x=0, $y=0, $z=0) |
|
| multiply ($number) |
|
| divide ($number) |
|
| ceil () |
|
| floor () |
|
| round () |
|
| abs () |
|
| getSide ($side, $step=1) |
|
| asVector3 () |
|
| distance (Vector3 $pos) |
|
| distanceSquared (Vector3 $pos) |
|
| maxPlainDistance ($x=0, $z=0) |
|
| length () |
|
| lengthSquared () |
|
| normalize () |
|
| dot (Vector3 $v) |
|
| cross (Vector3 $v) |
|
| equals (Vector3 $v) |
|
| getIntermediateWithXValue (Vector3 $v, $x) |
|
| getIntermediateWithYValue (Vector3 $v, $y) |
|
| getIntermediateWithZValue (Vector3 $v, $z) |
|
| setComponents ($x, $y, $z) |
|
| fromObjectAdd (Vector3 $pos, $x, $y, $z) |
|
| __toString () |
|
◆ __construct()
Tile constructor.
- Parameters
-
Level | $level | |
CompoundTag | $nbt | |
151 $this->namedtag = $nbt;
152 $this->server =
$level->getServer();
154 $this->chunk =
$level->getChunk($this->namedtag[
"x"] >> 4, $this->namedtag[
"z"] >> 4,
false);
155 assert($this->chunk !== null);
158 $this->lastUpdate = microtime(
true);
160 $this->x = (int) $this->namedtag[
"x"];
161 $this->y = (int) $this->namedtag[
"y"];
162 $this->z = (int) $this->namedtag[
"z"];
164 $this->chunk->addTile($this);
◆ __destruct()
◆ close()
207 $this->closed =
true;
208 unset($this->level->updateTiles[$this->id]);
209 if($this->chunk instanceof Chunk){
210 $this->chunk->removeTile($this);
213 $level->removeTile($this);
◆ createTile()
- Parameters
-
string | $type | |
Level | $level | |
CompoundTag | $nbt | |
array | $args | |
- Returns
- Tile
109 if(isset(self::$knownTiles[$type])){
110 $class = self::$knownTiles[$type];
111 return new $class(
$level, $nbt, ...$args);
◆ getBlock()
- Returns
187 return $this->level->getBlock($this);
◆ getId()
◆ getName()
◆ getSaveId()
Returns the short save name
- Returns
- string
139 return self::$shortNames[static::class];
◆ init()
81 self::registerTile(Beacon::class);
82 self::registerTile(Bed::class);
83 self::registerTile(BrewingStand::class);
84 self::registerTile(Cauldron::class);
85 self::registerTile(Chest::class);
86 self::registerTile(Dispenser::class);
87 self::registerTile(DLDetector::class);
88 self::registerTile(Dropper::class);
89 self::registerTile(EnchantTable::class);
90 self::registerTile(EnderChest::class);
91 self::registerTile(FlowerPot::class);
92 self::registerTile(Furnace::class);
93 self::registerTile(Hopper::class);
94 self::registerTile(ItemFrame::class);
95 self::registerTile(MobSpawner::class);
96 self::registerTile(Sign::class);
97 self::registerTile(Skull::class);
◆ onUpdate()
◆ registerTile()
static registerTile |
( |
|
$className | ) |
|
|
static |
- Parameters
-
- Returns
- bool
123 $class = new \ReflectionClass($className);
124 if(is_a($className, Tile::class,
true) and !$class->isAbstract()){
125 self::$knownTiles[$class->getShortName()] = $className;
126 self::$shortNames[$className] = $class->getShortName();
◆ saveNBT()
178 $this->namedtag->x =
new IntTag(
"x", $this->x);
179 $this->namedtag->y =
new IntTag(
"y", $this->y);
180 $this->namedtag->z =
new IntTag(
"z", $this->z);
◆ scheduleUpdate()
198 $this->level->updateTiles[
$this->id] = $this;
◆ $attach
◆ $chunk
◆ $closed
◆ $id
◆ $lastUpdate
◆ $metadata
◆ $name
◆ $namedtag
◆ $server
◆ $tickTimer
◆ $tileCount
◆ $timings
◆ $x
◆ $y
◆ $z
◆ BEACON
◆ BED
◆ BREWING_STAND
const BREWING_STAND = "BrewingStand" |
◆ CAULDRON
const CAULDRON = "Cauldron" |
◆ CHEST
◆ DAY_LIGHT_DETECTOR
const DAY_LIGHT_DETECTOR = "DLDetector" |
◆ DISPENSER
const DISPENSER = "Dispenser" |
◆ DL_DETECTOR
const DL_DETECTOR = "DayLightDetector" |
◆ DROPPER
const DROPPER = "Dropper" |
◆ ENCHANT_TABLE
const ENCHANT_TABLE = "EnchantTable" |
◆ ENDER_CHEST
const ENDER_CHEST = "EnderChest" |
◆ FLOWER_POT
const FLOWER_POT = "FlowerPot" |
◆ FURNACE
const FURNACE = "Furnace" |
◆ HOPPER
◆ ITEM_FRAME
const ITEM_FRAME = "ItemFrame" |
◆ MOB_SPAWNER
const MOB_SPAWNER = "MobSpawner" |
◆ SIGN
◆ SKULL
The documentation for this class was generated from the following file:
- src/pocketmine/tile/Tile.php