pocketmine\block\Cauldron::place PHP Метод

place() публичный Метод

public place ( Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null )
$item pocketmine\item\Item
$block Block
$target Block
$player pocketmine\Player
    public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null)
    {
        $nbt = new CompoundTag("", [new StringTag("id", Tile::CAULDRON), new IntTag("x", $block->x), new IntTag("y", $block->y), new IntTag("z", $block->z), new ShortTag("PotionId", 0xffff), new ByteTag("SplashPotion", 0), new ListTag("Items", [])]);
        if ($item->hasCustomBlockData()) {
            foreach ($item->getCustomBlockData() as $key => $v) {
                $nbt->{$key} = $v;
            }
        }
        $chunk = $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4);
        $tile = Tile::createTile("Cauldron", $chunk, $nbt);
        //
        $this->getLevel()->setBlock($block, $this, true, true);
        return true;
    }