mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Use Item->canStackWith() instead of Item->equals() wherever possible
This commit is contained in:
parent
867b8945e4
commit
fff8f0f815
@ -165,7 +165,7 @@ abstract class Furnace extends Spawnable implements Container, Nameable{
|
||||
|
||||
$furnaceType = $this->getFurnaceType();
|
||||
$smelt = $this->position->getWorld()->getServer()->getCraftingManager()->getFurnaceRecipeManager($furnaceType)->match($raw);
|
||||
$canSmelt = ($smelt instanceof FurnaceRecipe && $raw->getCount() > 0 && (($smelt->getResult()->equals($product) && $product->getCount() < $product->getMaxStackSize()) || $product->isNull()));
|
||||
$canSmelt = ($smelt instanceof FurnaceRecipe && $raw->getCount() > 0 && (($smelt->getResult()->canStackWith($product) && $product->getCount() < $product->getMaxStackSize()) || $product->isNull()));
|
||||
|
||||
if($this->remainingFuelTime <= 0 && $canSmelt && $fuel->getFuelTime() > 0 && $fuel->getCount() > 0){
|
||||
$this->checkFuel($fuel);
|
||||
|
@ -637,7 +637,7 @@ class Item implements \JsonSerializable{
|
||||
* Returns whether the specified item stack has the same ID, damage, NBT and count as this item stack.
|
||||
*/
|
||||
final public function equalsExact(Item $other) : bool{
|
||||
return $this->equals($other, true, true) && $this->count === $other->count;
|
||||
return $this->canStackWith($other) && $this->count === $other->count;
|
||||
}
|
||||
|
||||
final public function __toString() : string{
|
||||
|
Loading…
x
Reference in New Issue
Block a user