From fc7672c6bad62d84783861935f8a13eab5333e54 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 20 Jun 2020 21:44:05 +0100 Subject: [PATCH] World: remove temporalVector (premature cold path optimisation again) --- src/world/World.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/world/World.php b/src/world/World.php index 1b29d812f..90d1c6e92 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -227,8 +227,6 @@ class World implements ChunkManager{ /** @var Position */ private $temporalPosition; - /** @var Vector3 */ - private $temporalVector; /** @var int */ private $sleepTicks = 0; @@ -369,7 +367,6 @@ class World implements ChunkManager{ $this->timings = new WorldTimings($this); $this->temporalPosition = new Position(0, 0, 0, $this); - $this->temporalVector = new Vector3(0, 0, 0); } public function getTickRateTime() : float{ @@ -1407,7 +1404,7 @@ class World implements ChunkManager{ $orb = new ExperienceOrb(Location::fromObject($pos, $this, lcg_value() * 360, 0)); $orb->setXpValue($split); - $orb->setMotion($this->temporalVector->setComponents((lcg_value() * 0.2 - 0.1) * 2, lcg_value() * 0.4, (lcg_value() * 0.2 - 0.1) * 2)); + $orb->setMotion(new Vector3((lcg_value() * 0.2 - 0.1) * 2, lcg_value() * 0.4, (lcg_value() * 0.2 - 0.1) * 2)); $orb->spawnToAll(); $orbs[] = $orb;