FallableTrait: add default implementation of tickFalling() to reduce Fallable pollution (#5350)

this is only used by concrete powder currently, so it doesn't make much sense to reimplement it in every implementor of Fallable.
This commit is contained in:
IvanCraft623 2022-10-18 10:56:21 -05:00 committed by GitHub
parent 9f6c6b2b71
commit d1d5020c53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 4 additions and 20 deletions

View File

@ -95,8 +95,4 @@ class Anvil extends Transparent implements Fallable{
}
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
public function tickFalling() : ?Block{
return null;
}
}

View File

@ -44,10 +44,6 @@ class DragonEgg extends Transparent implements Fallable{
return 1;
}
public function tickFalling() : ?Block{
return null;
}
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
$this->teleport();
return true;

View File

@ -45,8 +45,4 @@ class Gravel extends Opaque implements Fallable{
public function isAffectedBySilkTouch() : bool{
return true;
}
public function tickFalling() : ?Block{
return null;
}
}

View File

@ -28,8 +28,4 @@ use pocketmine\block\utils\FallableTrait;
class Sand extends Opaque implements Fallable{
use FallableTrait;
public function tickFalling() : ?Block{
return null;
}
}

View File

@ -116,10 +116,6 @@ class SnowLayer extends Flowable implements Fallable{
}
}
public function tickFalling() : ?Block{
return null;
}
public function getDropsForCompatibleTool(Item $item) : array{
return [
VanillaItems::SNOWBALL()->setCount(max(1, (int) floor($this->layers / 2)))

View File

@ -54,4 +54,8 @@ trait FallableTrait{
$fall->spawnToAll();
}
}
public function tickFalling() : ?Block{
return null;
}
}