mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
Replace some ItemFactory blockitem fetches with VanillaBlocks::THING()->asItem()
This commit is contained in:
parent
41705db687
commit
e8fe3d0664
@ -49,7 +49,6 @@ use pocketmine\block\utils\InvalidBlockStateException;
|
||||
use pocketmine\block\utils\PillarRotationTrait;
|
||||
use pocketmine\block\utils\TreeType;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
use pocketmine\item\ItemIds;
|
||||
use pocketmine\item\TieredTool;
|
||||
use pocketmine\world\Position;
|
||||
@ -185,32 +184,32 @@ class BlockFactory{
|
||||
self::register(new Ice(new BID(Ids::ICE), "Ice"));
|
||||
self::register(new class(new BID(Ids::MONSTER_EGG, Meta::INFESTED_STONE), "Infested Stone") extends InfestedStone{
|
||||
public function getSilkTouchDrops(Item $item) : array{
|
||||
return [ItemFactory::get(ItemIds::STONE)];
|
||||
return [VanillaBlocks::STONE()->asItem()];
|
||||
}
|
||||
});
|
||||
self::register(new class(new BID(Ids::MONSTER_EGG, Meta::INFESTED_COBBLESTONE), "Infested Cobblestone") extends InfestedStone{
|
||||
public function getSilkTouchDrops(Item $item) : array{
|
||||
return [ItemFactory::get(ItemIds::COBBLESTONE)];
|
||||
return [VanillaBlocks::COBBLESTONE()->asItem()];
|
||||
}
|
||||
});
|
||||
self::register(new class(new BID(Ids::MONSTER_EGG, Meta::INFESTED_STONE_BRICK), "Infested Stone Brick") extends InfestedStone{
|
||||
public function getSilkTouchDrops(Item $item) : array{
|
||||
return [ItemFactory::get(ItemIds::STONE_BRICK)];
|
||||
return [VanillaBlocks::STONE_BRICKS()->asItem()];
|
||||
}
|
||||
});
|
||||
self::register(new class(new BID(Ids::MONSTER_EGG, Meta::INFESTED_STONE_BRICK_MOSSY), "Infested Mossy Stone Brick") extends InfestedStone{
|
||||
public function getSilkTouchDrops(Item $item) : array{
|
||||
return [ItemFactory::get(ItemIds::STONE_BRICK, Meta::STONE_BRICK_MOSSY)];
|
||||
return [VanillaBlocks::MOSSY_STONE_BRICKS()->asItem()];
|
||||
}
|
||||
});
|
||||
self::register(new class(new BID(Ids::MONSTER_EGG, Meta::INFESTED_STONE_BRICK_CRACKED), "Infested Cracked Stone Brick") extends InfestedStone{
|
||||
public function getSilkTouchDrops(Item $item) : array{
|
||||
return [ItemFactory::get(ItemIds::STONE_BRICK, Meta::STONE_BRICK_CRACKED)];
|
||||
return [VanillaBlocks::CRACKED_STONE_BRICKS()->asItem()];
|
||||
}
|
||||
});
|
||||
self::register(new class(new BID(Ids::MONSTER_EGG, Meta::INFESTED_STONE_BRICK_CHISELED), "Infested Chiseled Stone Brick") extends InfestedStone{
|
||||
public function getSilkTouchDrops(Item $item) : array{
|
||||
return [ItemFactory::get(ItemIds::STONE_BRICK, Meta::STONE_BRICK_CHISELED)];
|
||||
return [VanillaBlocks::CHISELED_STONE_BRICKS()->asItem()];
|
||||
}
|
||||
});
|
||||
|
||||
@ -318,7 +317,7 @@ class BlockFactory{
|
||||
$stoneBreakInfo = new BlockBreakInfo(1.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0);
|
||||
self::register(new class(new BID(Ids::STONE, Meta::STONE_NORMAL), "Stone", $stoneBreakInfo) extends Solid{
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [ItemFactory::get(Item::COBBLESTONE)];
|
||||
return [VanillaBlocks::COBBLESTONE()->asItem()];
|
||||
}
|
||||
});
|
||||
self::register(new Stair(new BID(Ids::NORMAL_STONE_STAIRS), "Stone Stairs", $stoneBreakInfo));
|
||||
|
@ -26,7 +26,6 @@ namespace pocketmine\block;
|
||||
use pocketmine\block\tile\EnderChest as TileEnderChest;
|
||||
use pocketmine\block\utils\BlockDataValidator;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
use pocketmine\item\TieredTool;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Facing;
|
||||
@ -85,7 +84,7 @@ class EnderChest extends Transparent{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [
|
||||
ItemFactory::get(Item::OBSIDIAN, 0, 8)
|
||||
VanillaBlocks::OBSIDIAN()->asItem()->setCount(8)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\block\utils\BlockDataValidator;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Facing;
|
||||
|
||||
@ -97,7 +96,7 @@ class Farmland extends Transparent{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [
|
||||
ItemFactory::get(Item::DIRT)
|
||||
VanillaBlocks::DIRT()->asItem()
|
||||
];
|
||||
}
|
||||
|
||||
@ -106,6 +105,6 @@ class Farmland extends Transparent{
|
||||
}
|
||||
|
||||
public function getPickedItem(bool $addUserData = false) : Item{
|
||||
return ItemFactory::get(Item::DIRT);
|
||||
return VanillaBlocks::DIRT()->asItem();
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ use pocketmine\event\block\BlockSpreadEvent;
|
||||
use pocketmine\item\Fertilizer;
|
||||
use pocketmine\item\Hoe;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
use pocketmine\item\Shovel;
|
||||
use pocketmine\math\Facing;
|
||||
use pocketmine\math\Vector3;
|
||||
@ -44,7 +43,7 @@ class Grass extends Solid{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [
|
||||
ItemFactory::get(Item::DIRT)
|
||||
VanillaBlocks::DIRT()->asItem()
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Facing;
|
||||
|
||||
@ -46,7 +45,7 @@ class GrassPath extends Transparent{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [
|
||||
ItemFactory::get(Item::DIRT)
|
||||
VanillaBlocks::DIRT()->asItem()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\event\block\BlockSpreadEvent;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
use pocketmine\math\Facing;
|
||||
use function mt_rand;
|
||||
|
||||
@ -37,7 +36,7 @@ class Mycelium extends Solid{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [
|
||||
ItemFactory::get(Item::DIRT)
|
||||
VanillaBlocks::DIRT()->asItem()
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user