mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-26 13:19:55 +00:00
Removed remaining usages of Item::get()
This commit is contained in:
parent
484f2f43c0
commit
52de5a6e49
@ -30,7 +30,7 @@ class BrownMushroomBlock extends RedMushroomBlock{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [
|
||||
Item::get(Item::BROWN_MUSHROOM, 0, mt_rand(0, 2))
|
||||
VanillaBlocks::BROWN_MUSHROOM()->asItem()->setCount(mt_rand(0, 2))
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class RedMushroomBlock extends Solid{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [
|
||||
Item::get(Item::RED_MUSHROOM, 0, mt_rand(0, 2))
|
||||
VanillaBlocks::RED_MUSHROOM()->asItem()->setCount(mt_rand(0, 2))
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ use pocketmine\inventory\transaction\action\InventoryAction;
|
||||
use pocketmine\inventory\transaction\CraftingTransaction;
|
||||
use pocketmine\inventory\transaction\InventoryTransaction;
|
||||
use pocketmine\inventory\transaction\TransactionValidationException;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\VanillaItems;
|
||||
use pocketmine\item\WritableBook;
|
||||
use pocketmine\item\WrittenBook;
|
||||
use pocketmine\math\Vector3;
|
||||
@ -640,7 +640,7 @@ class InGamePacketHandler extends PacketHandler{
|
||||
break;
|
||||
case BookEditPacket::TYPE_SIGN_BOOK:
|
||||
/** @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->setTitle($packet->title);
|
||||
$newBook->setGeneration(WrittenBook::GENERATION_ORIGINAL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user