mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Added cake eating
This commit is contained in:
parent
306cc9f00c
commit
28f6a964d4
3 changed files with 25 additions and 7 deletions
|
|
@ -340,9 +340,11 @@ class Player{
|
|||
return true;
|
||||
}
|
||||
|
||||
public function setSlot($slot, Item $item){
|
||||
public function setSlot($slot, Item $item, $send = true){
|
||||
$this->inventory[(int) $slot] = $item;
|
||||
$this->sendInventorySlot((int) $slot);
|
||||
if($send === true){
|
||||
$this->sendInventorySlot((int) $slot);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1387,7 +1389,7 @@ class Player{
|
|||
RAW_FISH => 2,
|
||||
|
||||
);
|
||||
if(isset($items[$this->getSlot($this->slot)->getID()])){
|
||||
if($this->entity->getHealth() < 20 and isset($items[$this->getSlot($this->slot)->getID()])){
|
||||
if($this->removeItem($this->getSlot($this->slot)->getID(), $this->getSlot($this->slot)->getMetadata(), 1, false) === true){
|
||||
$this->dataPacket(MC_ENTITY_EVENT, array(
|
||||
"eid" => 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue