mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +00:00
MovingObjectPosition: Use asVector3() instead of creating a new vector the hard way
This commit is contained in:
parent
dda71b06ae
commit
c64b9ad63a
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user