mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
isBaby added to entities.yml, armor fix
This commit is contained in:
parent
ca2bf73e06
commit
42fc07a888
3 changed files with 14 additions and 27 deletions
|
|
@ -440,31 +440,6 @@ class Player{
|
|||
return true;
|
||||
}
|
||||
|
||||
public function removeItem($type, $damage, $count, $send = true){
|
||||
while($count > 0){
|
||||
$remove = 0;
|
||||
foreach($this->inventory as $s => $item){
|
||||
if($item->getID() === $type and $item->getMetadata() === $damage){
|
||||
$remove = min($count, $item->count);
|
||||
if($remove < $item->count){
|
||||
$item->count -= $remove;
|
||||
}else{
|
||||
$this->inventory[$s] = BlockAPI::getItem(AIR, 0, 0);
|
||||
}
|
||||
if($send === true){
|
||||
$this->sendInventorySlot($s);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($remove <= 0){
|
||||
return false;
|
||||
}
|
||||
$count -= $remove;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $slot
|
||||
* @param Item $item
|
||||
|
|
@ -2328,7 +2303,14 @@ class Player{
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function damageArmorPart($slot, $part){
|
||||
$part->useOn($this->entity, true); //PocketMine is forced to do it =<. Even if PocketMine doesnt want, he have to damage your armor.
|
||||
if($part->getMetadata() >= $part->getMaxDurability()){
|
||||
$this->setArmor($slot, BlockAPI::getItem(AIR, 0, 0), false);
|
||||
return;
|
||||
}
|
||||
$this->setArmor($slot, $part, false);
|
||||
}
|
||||
/**
|
||||
* @param Player|string|boolean|void $player
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue