81    public function getContents(
bool $includeEmpty = 
false) : array{
 
   82        $contents = $this->actualInventory->getContents($includeEmpty);
 
   83        foreach($this->changedSlots as $index => $item){
 
   85                if($includeEmpty || !$item->isNull()){
 
   86                    $contents[$index] = clone $item;
 
   88                    unset($contents[$index]);
 
 
  100        foreach($this->changedSlots as $index => $newItem){
 
  101            if($newItem !== 
null){
 
  102                $oldItem = $this->actualInventory->getItem($index);
 
  103                if(!$newItem->equalsExact($oldItem)){
 
  104                    $result[] = 
new SlotChangeAction($this->actualInventory, $index, $oldItem, $newItem);