Added compound tag checking for Item->equals()

This commit is contained in:
Shoghi Cervantes
2015-08-06 20:25:22 +02:00
parent a65109ff34
commit 091d0b3ff9
7 changed files with 29 additions and 22 deletions

View File

@ -443,7 +443,7 @@ class CraftingManager{
foreach($ingredients as $item){
$amount = $item->getCount();
foreach($checkInput as $k => $checkItem){
if($checkItem->equals($item, $checkItem->getDamage() === null ? false : true)){
if($checkItem->equals($item, $checkItem->getDamage() === null ? false : true, $checkItem->getCompoundTag() === null ? false : true)){
$remove = min($checkItem->getCount(), $amount);
$checkItem->setCount($checkItem->getCount() - $remove);
if($checkItem->getCount() === 0){
@ -506,7 +506,7 @@ class CraftingManager{
foreach($input as $item){
$amount = $item->getCount();
foreach($checkInput as $k => $checkItem){
if($checkItem->equals($item, $checkItem->getDamage() === null ? false : true)){
if($checkItem->equals($item, $checkItem->getDamage() === null ? false : true, $checkItem->getCompoundTag() === null ? false : true)){
$remove = min($checkItem->getCount(), $amount);
$checkItem->setCount($checkItem->getCount() - $remove);
if($checkItem->getCount() === 0){
@ -540,7 +540,7 @@ class CraftingManager{
}
$checkResult = $recipe->getResult();
if($checkResult->equals($result, true) and $checkResult->getCount() === $result->getCount()){
if($checkResult->equals($result) and $checkResult->getCount() === $result->getCount()){
return $recipe;
}