mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
micro entity optimizations, fixed getEyeHeight, rewrote inWall, static hitboxes
This commit is contained in:
parent
0469550ca2
commit
2927fe1094
9 changed files with 54 additions and 94 deletions
|
|
@ -401,29 +401,11 @@ class Level{
|
|||
}
|
||||
$this->totalMobsAmount = 0;
|
||||
$post = [];
|
||||
//console("ELP {$this->getName()}");
|
||||
//var_dump($this->entityListPositioned);
|
||||
//console($this->getName());
|
||||
foreach($this->entityList as $k => $e){
|
||||
|
||||
if(!isset(CORRECT_ENTITY_CLASSES[$e->class])){
|
||||
ConsoleAPI::warn("Entity $k has invalid class type! {$e->class}");
|
||||
$e->close();
|
||||
unset($this->entityList[$k]);
|
||||
unset($this->server->entities[$k]);
|
||||
|
||||
$curChunkX = (int)$e->x >> 4;
|
||||
$curChunkZ = (int)$e->z >> 4;
|
||||
$index = "$curChunkX $curChunkZ";
|
||||
|
||||
if(isset($this->entityListPositioned[$index]) && isset($this->entityListPositioned[$index][$k])){
|
||||
unset($this->entityListPositioned[$index][$k]);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
$dd = CORRECT_ENTITY_CLASSES[$e->class];
|
||||
if($dd !== true && !isset($dd[$e->type])){
|
||||
ConsoleAPI::warn("Entity $k has invalid entity type! {$e->class} {$e->type}");
|
||||
$dd = CORRECT_ENTITY_CLASSES[$e->class] ?? false;
|
||||
if($dd === false || ($dd !== true && !isset($dd[$e->type]))){
|
||||
ConsoleAPI::warn("Entity $k has invalid entity! {$e->class} {$e->type}");
|
||||
$e->close();
|
||||
|
||||
unset($this->entityList[$k]);
|
||||
|
|
@ -440,8 +422,6 @@ class Level{
|
|||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!($e instanceof Entity)){
|
||||
unset($this->entityList[$k]);
|
||||
unset($this->server->entities[$k]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue