public function setDirection($face, $isOnSlope = false)
{
$extrabitset = ($this->meta & 0x8) === 0x8;
if ($face !== Vector3::SIDE_WEST && $face !== Vector3::SIDE_EAST && $face !== Vector3::SIDE_NORTH && $face !== Vector3::SIDE_SOUTH) {
throw new IllegalArgumentException("This rail variant can't be on a curve!");
}
$this->meta = $extrabitset ? $this->meta | 0x8 : $this->meta & ~0x8;
$this->getLevel()->setBlock($this, Block::get($this->id, $this->meta));
}