mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
armor will actually be removed now
This commit is contained in:
parent
02a038a7f7
commit
294745fb09
3 changed files with 6 additions and 1 deletions
|
|
@ -2355,7 +2355,7 @@ class Player{
|
|||
$slot = $this->armor[$i];
|
||||
|
||||
if($slot->getID() !== AIR && $s->getID() === AIR){
|
||||
$this->addItem($slot->getID(), $slot->getMetadata(), 1, false);
|
||||
$this->addItem($slot->getID(), $slot->getMetadata(), $slot->count, false);
|
||||
$this->armor[$i] = BlockAPI::getItem(AIR, 0, 0);
|
||||
$packet->slots[$i] = 255;
|
||||
}elseif($s->getID() !== AIR and $slot->getID() === AIR and ($sl = $this->hasItem($s->getID())) !== false){
|
||||
|
|
|
|||
|
|
@ -1567,6 +1567,7 @@ class Entity extends Position
|
|||
|
||||
foreach($this->player->armor as $slot => $part){
|
||||
$part->hurtAndBreak($v2, $this->player, helditem: false);
|
||||
if($part->count <= 0) $this->player->setArmor($slot, BlockAPI::getItem(0, 0, 0), send: false);
|
||||
}
|
||||
$this->player->sendArmor();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,6 +236,10 @@ class Item{
|
|||
if($this->meta > $this->getMaxDurability()){
|
||||
$player->consumeSingleItem();
|
||||
}
|
||||
}else{
|
||||
if($this->meta > $this->getMaxDurability()){
|
||||
--$this->count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue