blockX} {$this->blockY} {$this->blockZ}, side: {$this->sideHit} hitVec: {$this->hitVector} entityHit: {$this->entityHit}}"; } /** * @param int $x * @param int $y * @param int $z * @param int $side * @param Vector3 $hitVector * * @return MovingObjectPosition */ public static function fromBlock($x, $y, $z, $side, Vector3 $hitVector){ $ob = new MovingObjectPosition; $ob->typeOfHit = 0; $ob->blockX = $x; $ob->blockY = $y; $ob->blockZ = $z; $ob->sideHit = $side; $ob->hitVector = new Vector3($hitVector->x, $hitVector->y, $hitVector->z); return $ob; } /** * @param Entity $entity * * @return MovingObjectPosition */ public static function fromEntity(Entity $entity){ $ob = new MovingObjectPosition; $ob->typeOfHit = 1; $ob->entityHit = $entity; $ob->hitVector = new Vector3($entity->x, $entity->y, $entity->z); return $ob; } }