mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Added individual object timings to Entities / Tile Entities
This commit is contained in:
@ -170,6 +170,8 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->timings->startTiming();
|
||||
|
||||
$ret = false;
|
||||
|
||||
$fuel = $this->inventory->getFuel();
|
||||
@ -248,6 +250,8 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
|
||||
$this->lastUpdate = microtime(true);
|
||||
|
||||
$this->timings->stopTiming();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ abstract class Tile extends Position{
|
||||
public $namedtag;
|
||||
protected $lastUpdate;
|
||||
protected $server;
|
||||
protected $timings;
|
||||
|
||||
/** @var \pocketmine\event\TimingsHandler */
|
||||
public $tickTimer;
|
||||
@ -63,6 +64,8 @@ abstract class Tile extends Position{
|
||||
throw new \Exception("Invalid garbage Chunk given to Tile");
|
||||
}
|
||||
|
||||
$this->timings = Timings::getTileEntityTimings($this);
|
||||
|
||||
$this->server = $chunk->getProvider()->getLevel()->getServer();
|
||||
$this->chunk = $chunk;
|
||||
$this->setLevel($chunk->getProvider()->getLevel());
|
||||
|
Reference in New Issue
Block a user