Made some changes for 0.12

This commit is contained in:
Shoghi Cervantes
2015-06-26 13:49:38 -07:00
committed by Shoghi Cervantes
parent 0380e9009a
commit 4258e22c02
18 changed files with 227 additions and 108 deletions

View File

@ -111,7 +111,11 @@ class Chest extends Spawnable implements InventoryHolder, Container{
if($i < 0){
return Item::get(Item::AIR, 0, 0);
}else{
return Item::get($this->namedtag->Items[$i]["id"], $this->namedtag->Items[$i]["Damage"], $this->namedtag->Items[$i]["Count"]);
$item = Item::get($this->namedtag->Items[$i]["id"], $this->namedtag->Items[$i]["Damage"], $this->namedtag->Items[$i]["Count"]);
if(isset($this->namedtag->Items[$i]["tag"])){
$item->setNamedTag($this->namedtag->Items[$i]["tag"]);
}
return $item;
}
}
@ -132,6 +136,11 @@ class Chest extends Spawnable implements InventoryHolder, Container{
new Short("id", $item->getId()),
new Short("Damage", $item->getDamage()),
]);
if($item->hasCompoundTag() and ($tag = $item->getNamedTag()) !== null){
$tag->setName("tag");
$d->tag = $tag;
}
if($item->getId() === Item::AIR or $item->getCount() <= 0){
if($i >= 0){
@ -270,4 +279,4 @@ class Chest extends Spawnable implements InventoryHolder, Container{
]);
}
}
}
}