More changes! Alsp added Anvil block and BinaryStream

This commit is contained in:
Shoghi Cervantes
2015-08-03 18:04:13 +02:00
parent 522932d7c0
commit 7fd053fb09
13 changed files with 422 additions and 202 deletions

View File

@ -1910,8 +1910,11 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$packet->slot -= 9; //Get real block slot
}
/** @var Item $item */
$item = null;
if($this->isCreative()){ //Creative mode match
$item = Item::get($packet->item, $packet->meta, 1);
$item = $packet->item;
$slot = Item::getCreativeItemIndex($item);
}else{
$item = $this->inventory->getItem($packet->slot);
@ -1942,7 +1945,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
break;
}
}
}elseif(!isset($item) or $slot === -1 or $item->getId() !== $packet->item or $item->getDamage() !== $packet->meta){ // packet error or not implemented
}elseif($item === null or $slot === -1 or $item->equals($packet->item, true)){ // packet error or not implemented
$this->inventory->sendContents($this);
break;
}elseif($this->isCreative()){