activated; } /** @return $this */ public function setActivated(bool $activated) : self{ $this->activated = $activated; return $this; } protected function readRailShapeFromMeta(int $stateMeta) : ?int{ $stateMeta &= ~BlockLegacyMetadata::REDSTONE_RAIL_FLAG_POWERED; return isset(self::CONNECTIONS[$stateMeta]) ? $stateMeta : null; } protected function writeStateToMeta() : int{ return parent::writeStateToMeta() | ($this->activated ? BlockLegacyMetadata::REDSTONE_RAIL_FLAG_POWERED : 0); } public function readStateFromData(int $id, int $stateMeta) : void{ parent::readStateFromData($id, $stateMeta); $this->activated = ($stateMeta & BlockLegacyMetadata::REDSTONE_RAIL_FLAG_POWERED) !== 0; } protected function getCurrentShapeConnections() : array{ return self::CONNECTIONS[$this->railShape]; } //TODO }