Added TallGrassTrait, remove weirdly specific logic from FortuneDropHelper

this needs to be dealt with before release otherwise we'll be stuck with FortuneDropHelper::grass()
this is the obvious solution and should have been done some time ago - stuff like flammability was already a problem for double tall grass anyway
This commit is contained in:
Dylan K. Taylor
2023-08-01 12:33:36 +01:00
parent 46f24b165a
commit 0a90a5928a
4 changed files with 61 additions and 40 deletions

View File

@ -23,10 +23,13 @@ declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\utils\FortuneDropHelper;
use pocketmine\block\utils\TallGrassTrait;
use pocketmine\item\Item;
class DoubleTallGrass extends DoublePlant{
use TallGrassTrait {
getDropsForIncompatibleTool as traitGetDropsForIncompatibleTool;
}
public function canBeReplaced() : bool{
return true;
@ -34,7 +37,7 @@ class DoubleTallGrass extends DoublePlant{
public function getDropsForIncompatibleTool(Item $item) : array{
if($this->top){
return FortuneDropHelper::grass($item);
return $this->traitGetDropsForIncompatibleTool($item);
}
return [];
}