mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Fixed cannot use items with custom NBT in regular crafting recipe, close #135
This commit is contained in:
parent
5443b10257
commit
77b3cd71a3
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user