Allow armor replacing (changing armor to another armor)

This commit is contained in:
Shoghi Cervantes 2013-08-20 11:23:55 +02:00
parent e42314ade7
commit a34595292d
3 changed files with 10 additions and 3 deletions

View file

@ -1432,6 +1432,10 @@ class Player{
}elseif($s->getID() !== AIR and $slot->getID() === AIR and ($sl = $this->hasItem($s->getID())) !== false){
$this->armor[$i] = $this->getSlot($sl);
$this->setSlot($sl, BlockAPI::getItem(AIR, 0, 0), false);
}elseif($s->getID() !== AIR and $slot->getID() !== AIR and ($sl = $this->hasItem($s->getID())) !== false){
$item = $this->armor[$i];
$this->armor[$i] = $this->getSlot($sl);
$this->setSlot($sl, $item, false);
}else{
$data["slot$i"] = 255;
}