mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
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:
parent
9f6c6b2b71
commit
d1d5020c53
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -45,8 +45,4 @@ class Gravel extends Opaque implements Fallable{
|
||||
public function isAffectedBySilkTouch() : bool{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function tickFalling() : ?Block{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,4 @@ use pocketmine\block\utils\FallableTrait;
|
||||
|
||||
class Sand extends Opaque implements Fallable{
|
||||
use FallableTrait;
|
||||
|
||||
public function tickFalling() : ?Block{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -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)))
|
||||
|
@ -54,4 +54,8 @@ trait FallableTrait{
|
||||
$fall->spawnToAll();
|
||||
}
|
||||
}
|
||||
|
||||
public function tickFalling() : ?Block{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user