meta = $meta; } public function getName() : string{ return "End Rod"; } public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ if($face === Vector3::SIDE_UP or $face === Vector3::SIDE_DOWN){ $this->meta = $face; }else{ $this->meta = $face ^ 0x01; } if($blockClicked instanceof EndRod and $blockClicked->getDamage() === $this->meta){ $this->meta ^= 0x01; } return $this->level->setBlock($blockReplace, $this, true, true); } public function isSolid() : bool{ return true; } public function getLightLevel() : int{ return 14; } protected function recalculateBoundingBox(){ $m = $this->meta & ~0x01; $width = 0.375; switch($m){ case 0x00: //up/down return new AxisAlignedBB( $this->x + $width, $this->y, $this->z + $width, $this->x + 1 - $width, $this->y + 1, $this->z + 1 - $width ); case 0x02: //north/south return new AxisAlignedBB( $this->x, $this->y + $width, $this->z + $width, $this->x + 1, $this->y + 1 - $width, $this->z + 1 - $width ); case 0x04: //east/west return new AxisAlignedBB( $this->x + $width, $this->y + $width, $this->z, $this->x + 1 - $width, $this->y + 1 - $width, $this->z + 1 ); } return null; } public function getVariantBitmask() : int{ return 0; } }