mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Made some changes for 0.12
This commit is contained in:
committed by
Shoghi Cervantes
parent
0380e9009a
commit
4258e22c02
@ -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{
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user