mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
InventoryManager: avoid calling TypeConverter::getInstance() in a loop
This commit is contained in:
parent
ee72e80fbb
commit
ecc830a689
@ -479,8 +479,9 @@ class InventoryManager{
|
||||
$entry->predictions = [];
|
||||
$entry->pendingSyncs = [];
|
||||
$contents = [];
|
||||
$typeConverter = TypeConverter::getInstance();
|
||||
foreach($inventory->getContents(true) as $slot => $item){
|
||||
$itemStack = TypeConverter::getInstance()->coreItemStackToNet($item);
|
||||
$itemStack = $typeConverter->coreItemStackToNet($item);
|
||||
$info = $this->trackItemStack($entry, $slot, $itemStack, null);
|
||||
$contents[] = new ItemStackWrapper($info->getStackId(), $itemStack);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user