mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Use new Location objects instead of mutating Entity->location directly
I'm actually not a big fan of needing to recreate the whole thing just to modify the coordinates. This seems kind of stupid.
This commit is contained in:
@ -219,9 +219,12 @@ abstract class Projectile extends Entity{
|
||||
}
|
||||
}
|
||||
|
||||
$this->location->x = $end->x;
|
||||
$this->location->y = $end->y;
|
||||
$this->location->z = $end->z;
|
||||
$this->location = Location::fromObject(
|
||||
$end,
|
||||
$this->location->world,
|
||||
$this->location->yaw,
|
||||
$this->location->pitch
|
||||
);
|
||||
$this->recalculateBoundingBox();
|
||||
|
||||
if($hitResult !== null){
|
||||
|
Reference in New Issue
Block a user