Added ItemFactory::air() sugar

This makes it easier to create air stacks without accidents, and also reduces the amount of throwaway air objects which get created.
This commit is contained in:
Dylan K. Taylor
2019-02-16 11:58:08 +00:00
parent 0ac7164b16
commit b252be1c7a
12 changed files with 24 additions and 20 deletions

View File

@@ -36,7 +36,7 @@ class FlintSteel extends Tool{
}
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : ItemUseResult{
if($blockReplace->getId() === self::AIR){
if($blockReplace->getId() === Block::AIR){
$level = $player->getLevel();
assert($level !== null);
$level->setBlock($blockReplace, BlockFactory::get(Block::FIRE));