diff --git a/src/inventory/BaseInventory.php b/src/inventory/BaseInventory.php index 589254d85..5700923ac 100644 --- a/src/inventory/BaseInventory.php +++ b/src/inventory/BaseInventory.php @@ -146,7 +146,7 @@ abstract class BaseInventory implements Inventory{ $checkTags = $exact || $item->hasNamedTag(); foreach($this->getContents() as $index => $i){ - if($item->equals($i, $checkDamage, $checkTags) and ($i->getCount() === $count or (!$exact and $i->getCount() > $count))){ + if($item->equals($i, $checkDamage, $checkTags) && ($i->getCount() === $count || (!$exact && $i->getCount() > $count))){ return $index; } } @@ -224,7 +224,7 @@ abstract class BaseInventory implements Inventory{ $emptySlots[] = $i; } - if($slot->canStackWith($item) and $item->getCount() < $item->getMaxStackSize()){ + if($slot->canStackWith($item) && $item->getCount() < $item->getMaxStackSize()){ $amount = min($item->getMaxStackSize() - $item->getCount(), $slot->getCount(), $this->getMaxStackSize()); if($amount > 0){ $slot->setCount($slot->getCount() - $amount); @@ -367,7 +367,7 @@ abstract class BaseInventory implements Inventory{ } public function slotExists(int $slot) : bool{ - return $slot >= 0 and $slot < $this->getSize(); + return $slot >= 0 && $slot < $this->getSize(); } public function getListeners() : ObjectSet{ diff --git a/src/inventory/PlayerInventory.php b/src/inventory/PlayerInventory.php index 253ddfdea..1da30d2e9 100644 --- a/src/inventory/PlayerInventory.php +++ b/src/inventory/PlayerInventory.php @@ -49,7 +49,7 @@ class PlayerInventory extends SimpleInventory{ } public function isHotbarSlot(int $slot) : bool{ - return $slot >= 0 and $slot <= $this->getHotbarSize(); + return $slot >= 0 && $slot <= $this->getHotbarSize(); } /** diff --git a/src/inventory/transaction/CraftingTransaction.php b/src/inventory/transaction/CraftingTransaction.php index 0d13ccbed..953199089 100644 --- a/src/inventory/transaction/CraftingTransaction.php +++ b/src/inventory/transaction/CraftingTransaction.php @@ -92,7 +92,7 @@ class CraftingTransaction extends InventoryTransaction{ $haveCount = 0; foreach($txItems as $j => $txItem){ - if($txItem->equals($recipeItem, !$wildcards or !$recipeItem->hasAnyDamageValue(), !$wildcards or $recipeItem->hasNamedTag())){ + if($txItem->equals($recipeItem, !$wildcards || !$recipeItem->hasAnyDamageValue(), !$wildcards || $recipeItem->hasNamedTag())){ $haveCount += $txItem->getCount(); unset($txItems[$j]); }