82 public function getContents(
bool $includeEmpty =
false) : array{
83 $contents = $this->inventoryWindow->getInventory()->getContents($includeEmpty);
84 foreach($this->changedSlots as $index => $item){
86 if($includeEmpty || !$item->isNull()){
87 $contents[$index] = clone $item;
89 unset($contents[$index]);
109 $inventory = $this->inventoryWindow->getInventory();
110 foreach($this->changedSlots as $index => $newItem){
111 if($newItem !==
null){
112 $oldItem = $inventory->getItem($index);
113 if(!$newItem->equalsExact($oldItem)){
114 $result[] =
new SlotChangeAction($this->inventoryWindow, $index, $oldItem, $newItem);