Fixed cannot use items with custom NBT in regular crafting recipe, close #135

This commit is contained in:
Dylan K. Taylor 2016-12-21 14:55:13 +00:00
parent 5443b10257
commit 77b3cd71a3
2 changed files with 2 additions and 2 deletions

View File

@ -2729,7 +2729,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
foreach($ingredients as $ingredient){
$slot = -1;
foreach($this->inventory->getContents() as $index => $item){
if($ingredient->getId() !== 0 and $ingredient->deepEquals($item, !$ingredient->hasAnyDamageValue()) and ($item->getCount() - $used[$index]) >= 1){
if($ingredient->getId() !== 0 and $ingredient->equals($item, !$ingredient->hasAnyDamageValue(), $ingredient->hasCompoundTag()) and ($item->getCount() - $used[$index]) >= 1){
$slot = $index;
$used[$index]++;
break;

View File

@ -337,7 +337,7 @@ class Item implements ItemIds, \JsonSerializable{
}
}
public function __construct(int $id, $meta = 0, int $count = 1, string $name = "Unknown"){
public function __construct(int $id, int $meta = 0, int $count = 1, string $name = "Unknown"){
$this->id = $id & 0xffff;
$this->meta = $meta !== -1 ? $meta & 0xffff : -1;
$this->count = $count;