Remove circular dependency between Item and NBT modules (#121)

This commit is contained in:
Dylan K. Taylor
2016-11-25 10:17:50 +00:00
committed by GitHub
parent a0111d04ee
commit e51a2725de
7 changed files with 68 additions and 64 deletions

View File

@ -138,7 +138,7 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
if($i < 0){
return Item::get(Item::AIR, 0, 0);
}else{
return NBT::getItemHelper($this->namedtag->Items[$i]);
return Item::nbtDeserialize($this->namedtag->Items[$i]);
}
}
@ -153,7 +153,7 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
public function setItem($index, Item $item){
$i = $this->getSlotIndex($index);
$d = NBT::putItemHelper($item, $index);
$d = $item->nbtSerialize($index);
if($item->getId() === Item::AIR or $item->getCount() <= 0){
if($i >= 0){