mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-19 09:54:10 +00:00
Improve painting performance
these really shouldn't hit the CPU at all considering they are simply static objects ...
This commit is contained in:
parent
6d6f8c3c38
commit
10067c1043
@ -998,6 +998,14 @@ abstract class Entity{
|
|||||||
$this->scheduleUpdate();
|
$this->scheduleUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a random update is performed on the chunk the entity is in. This happens when the chunk is within the
|
||||||
|
* ticking chunk range of a player (or chunk loader).
|
||||||
|
*/
|
||||||
|
public function onRandomUpdate() : void{
|
||||||
|
$this->scheduleUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flags the entity as needing a movement update on the next tick. Setting this forces a movement update even if the
|
* Flags the entity as needing a movement update on the next tick. Setting this forces a movement update even if the
|
||||||
* entity's motion is zero. Used to trigger movement updates when blocks change near entities.
|
* entity's motion is zero. Used to trigger movement updates when blocks change near entities.
|
||||||
|
@ -132,6 +132,10 @@ class Painting extends Entity{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onRandomUpdate() : void{
|
||||||
|
//NOOP
|
||||||
|
}
|
||||||
|
|
||||||
public function hasMovementUpdate() : bool{
|
public function hasMovementUpdate() : bool{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -968,7 +968,7 @@ class World implements ChunkManager{
|
|||||||
|
|
||||||
$chunk = $this->chunks[$index];
|
$chunk = $this->chunks[$index];
|
||||||
foreach($chunk->getEntities() as $entity){
|
foreach($chunk->getEntities() as $entity){
|
||||||
$entity->scheduleUpdate();
|
$entity->onRandomUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($chunk->getSubChunks() as $Y => $subChunk){
|
foreach($chunk->getSubChunks() as $Y => $subChunk){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user