mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
item entities will try to combine with neatby items of the same type
This commit is contained in:
parent
6ba62666c3
commit
4b17edfc05
4 changed files with 88 additions and 29 deletions
|
|
@ -217,9 +217,12 @@ class EntityAPI{
|
|||
for($chunkX = $minChunkX; $chunkX <= $maxChunkX; ++$chunkX){
|
||||
for($chunkZ = $minChunkZ; $chunkZ <= $maxChunkZ; ++$chunkZ){
|
||||
$ind = "$chunkX $chunkZ";
|
||||
foreach($center->level->entityListPositioned[$ind] ?? [] as $entid){
|
||||
if($this->entities[$entid] instanceof Entity && ($class === false || $this->entities[$entid]->class == $class)){
|
||||
foreach($center->level->entityListPositioned[$ind] ?? [] as $ind2 => $entid){
|
||||
if(isset($this->entities[$entid]) && $this->entities[$entid] instanceof Entity && ($class === false || $this->entities[$entid]->class == $class)){
|
||||
$ents[$entid] = $this->entities[$entid];
|
||||
}else if(!isset($this->entities[$entid])){
|
||||
ConsoleAPI::debug("Removing entity from level array at index $ind/$ind2: $entid");
|
||||
unset($center->level->entityListPositioned[$ind][$ind2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue