mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Cleaned up bool comparison mess
This commit is contained in:
@ -840,7 +840,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
* @return bool
|
||||
*/
|
||||
final public function equals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{
|
||||
if($this->id === $item->getId() and ($checkDamage === false or $this->getDamage() === $item->getDamage())){
|
||||
if($this->id === $item->getId() and (!$checkDamage or $this->getDamage() === $item->getDamage())){
|
||||
if($checkCompound){
|
||||
if($item->getCompoundTag() === $this->getCompoundTag()){
|
||||
return true;
|
||||
|
@ -335,7 +335,7 @@ class ItemFactory{
|
||||
* @throws \InvalidArgumentException if the given string cannot be parsed as an item identifier
|
||||
*/
|
||||
public static function fromString(string $str, bool $multiple = false){
|
||||
if($multiple === true){
|
||||
if($multiple){
|
||||
$blocks = [];
|
||||
foreach(explode(",", $str) as $b){
|
||||
$blocks[] = self::fromString($b, false);
|
||||
|
Reference in New Issue
Block a user