Use SplFixedArrays in inventory, added more typehints and cleaned up some duplicated code

This commit is contained in:
Dylan K. Taylor
2017-08-09 13:12:07 +01:00
parent 75644b5df2
commit 260179197b
9 changed files with 152 additions and 175 deletions

View File

@ -48,6 +48,7 @@ class FurnaceInventory extends ContainerInventory{
}
/**
* This override is here for documentation and code completion purposes only.
* @return Furnace
*/
public function getHolder(){
@ -102,8 +103,8 @@ class FurnaceInventory extends ContainerInventory{
return $this->setItem(0, $item);
}
public function onSlotChange($index, $before){
parent::onSlotChange($index, $before);
public function onSlotChange(int $index, Item $before, bool $send){
parent::onSlotChange($index, $before, $send);
$this->getHolder()->scheduleUpdate();
}