mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Allow armor replacing (changing armor to another armor)
This commit is contained in:
parent
e42314ade7
commit
a34595292d
3 changed files with 10 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue