From 69e29236aadf1c21eb17d857ff4052e6b6ded4e8 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 8 Oct 2017 12:50:53 +0100 Subject: [PATCH] Remove some redundant code for checking existence of creative items getCreativeItemIndex() does basically the same thing anyway --- src/pocketmine/item/Item.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index bdc87bf17..fcf10c754 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -144,13 +144,7 @@ class Item implements ItemIds, \JsonSerializable{ } public static function isCreativeItem(Item $item) : bool{ - foreach(Item::$creative as $i => $d){ - if($item->equals($d, !$item->isTool())){ - return true; - } - } - - return false; + return Item::getCreativeItemIndex($item) !== -1; } /**