diff --git a/core/classes/Shop.php b/core/classes/Shop.php index 2007a800361f357166103dc262960111be70da4e..1107786cf1f92a361d899b0c4eef4cca6438d4c7 100644 --- a/core/classes/Shop.php +++ b/core/classes/Shop.php @@ -3,17 +3,24 @@ class Shop{ public static function getAllProducts(){ $itemConfig = Connexion::pdo()->query("SELECT itemConfig FROM qs_shops")->fetchColumn(); $items = yaml_parse($itemConfig); + + /* + item: + ==: org.bukkit.inventory.ItemStack + v: 2865 + type: WHEAT + */ $return = array(); foreach($items as $item){ $itemAleadyEntered = false; foreach($return as $checkItem){ - if($item == $checkItem->getId()){ + if($item->item->type == $checkItem->getId()){ $itemAleadyEntered = true; } } if(!$itemAleadyEntered){ - $return[] = new Item($item); + $return[] = new Item($item->item->type); } } return $return;