Removed remaining usages of Item::get()

This commit is contained in:
Dylan K. Taylor 2019-07-16 14:27:32 +01:00
parent 484f2f43c0
commit 52de5a6e49
3 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ class BrownMushroomBlock extends RedMushroomBlock{
public function getDropsForCompatibleTool(Item $item) : array{ public function getDropsForCompatibleTool(Item $item) : array{
return [ return [
Item::get(Item::BROWN_MUSHROOM, 0, mt_rand(0, 2)) VanillaBlocks::BROWN_MUSHROOM()->asItem()->setCount(mt_rand(0, 2))
]; ];
} }
} }

View File

@ -55,7 +55,7 @@ class RedMushroomBlock extends Solid{
public function getDropsForCompatibleTool(Item $item) : array{ public function getDropsForCompatibleTool(Item $item) : array{
return [ return [
Item::get(Item::RED_MUSHROOM, 0, mt_rand(0, 2)) VanillaBlocks::RED_MUSHROOM()->asItem()->setCount(mt_rand(0, 2))
]; ];
} }
} }

View File

@ -31,7 +31,7 @@ use pocketmine\inventory\transaction\action\InventoryAction;
use pocketmine\inventory\transaction\CraftingTransaction; use pocketmine\inventory\transaction\CraftingTransaction;
use pocketmine\inventory\transaction\InventoryTransaction; use pocketmine\inventory\transaction\InventoryTransaction;
use pocketmine\inventory\transaction\TransactionValidationException; use pocketmine\inventory\transaction\TransactionValidationException;
use pocketmine\item\Item; use pocketmine\item\VanillaItems;
use pocketmine\item\WritableBook; use pocketmine\item\WritableBook;
use pocketmine\item\WrittenBook; use pocketmine\item\WrittenBook;
use pocketmine\math\Vector3; use pocketmine\math\Vector3;
@ -640,7 +640,7 @@ class InGamePacketHandler extends PacketHandler{
break; break;
case BookEditPacket::TYPE_SIGN_BOOK: case BookEditPacket::TYPE_SIGN_BOOK:
/** @var WrittenBook $newBook */ /** @var WrittenBook $newBook */
$newBook = Item::get(Item::WRITTEN_BOOK, 0, 1, $newBook->getNamedTag()); $newBook = VanillaItems::WRITTEN_BOOK()->setNamedTag($oldBook->getNamedTag());
$newBook->setAuthor($packet->author); $newBook->setAuthor($packet->author);
$newBook->setTitle($packet->title); $newBook->setTitle($packet->title);
$newBook->setGeneration(WrittenBook::GENERATION_ORIGINAL); $newBook->setGeneration(WrittenBook::GENERATION_ORIGINAL);