Do not cache ItemStacks for every item

this is very memory inefficient, and only provides a performance advantage in cold code anyway.
This commit is contained in:
Dylan K. Taylor
2023-03-20 23:18:43 +00:00
parent 1992d3b6db
commit 63310cf764
4 changed files with 14 additions and 21 deletions

View File

@ -23,19 +23,14 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStack;
final class ItemStackInfo{
public function __construct(
private ?int $requestId,
private int $stackId,
private ItemStack $itemStack
private int $stackId
){}
public function getRequestId() : ?int{ return $this->requestId; }
public function getStackId() : int{ return $this->stackId; }
public function getItemStack() : ItemStack{ return $this->itemStack; }
}