public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null)
{
if ($player instanceof Player) {
$pitch = $player->getPitch();
if (abs($pitch) >= 45) {
if ($pitch < 0) {
$f = 0;
} else {
$f = 1;
}
} else {
$f = $player->getDirection() + 2;
}
} else {
$f = 0;
}
$faces = [0 => 0, 1 => 1, 2 => 4, 3 => 2, 4 => 5, 5 => 3];
$this->meta = $faces[$f];
$this->getLevel()->setBlock($block, $this, true, true);
$nbt = new CompoundTag("", [new ListTag("Items", []), new StringTag("id", Tile::DROPPER), new IntTag("x", $this->x), new IntTag("y", $this->y), new IntTag("z", $this->z)]);
$nbt->Items->setTagType(NBT::TAG_Compound);
if ($item->hasCustomName()) {
$nbt->CustomName = new StringTag("CustomName", $item->getCustomName());
}
if ($item->hasCustomBlockData()) {
foreach ($item->getCustomBlockData() as $key => $v) {
$nbt->{$key} = $v;
}
}
Tile::createTile(Tile::DROPPER, $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
return true;
}