MovingObjectPosition: Use asVector3() instead of creating a new vector the hard way

This commit is contained in:
Dylan K. Taylor 2017-12-26 15:37:00 +00:00
parent dda71b06ae
commit c64b9ad63a

View File

@ -73,7 +73,7 @@ class MovingObjectPosition{
$ob->blockY = $y; $ob->blockY = $y;
$ob->blockZ = $z; $ob->blockZ = $z;
$ob->sideHit = $side; $ob->sideHit = $side;
$ob->hitVector = new Vector3($hitVector->x, $hitVector->y, $hitVector->z); $ob->hitVector = $hitVector->asVector3();
return $ob; return $ob;
} }
@ -86,7 +86,7 @@ class MovingObjectPosition{
$ob = new MovingObjectPosition; $ob = new MovingObjectPosition;
$ob->typeOfHit = self::TYPE_ENTITY_COLLISION; $ob->typeOfHit = self::TYPE_ENTITY_COLLISION;
$ob->entityHit = $entity; $ob->entityHit = $entity;
$ob->hitVector = new Vector3($entity->x, $entity->y, $entity->z); $ob->hitVector = $entity->asVector3();
return $ob; return $ob;
} }
} }