Make more use of PoweredByRedstoneTrait

This commit is contained in:
Dylan K. Taylor
2021-02-06 18:43:33 +00:00
parent 48ef8771cd
commit 5be03c3196
4 changed files with 8 additions and 30 deletions

View File

@ -26,6 +26,7 @@ namespace pocketmine\block;
use pocketmine\block\tile\Hopper as TileHopper;
use pocketmine\block\utils\BlockDataSerializer;
use pocketmine\block\utils\InvalidBlockStateException;
use pocketmine\block\utils\PoweredByRedstoneTrait;
use pocketmine\item\Item;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
@ -34,11 +35,10 @@ use pocketmine\player\Player;
use pocketmine\world\BlockTransaction;
class Hopper extends Transparent{
use PoweredByRedstoneTrait;
/** @var int */
private $facing = Facing::DOWN;
/** @var bool */
private $powered = false;
public function readStateFromData(int $id, int $stateMeta) : void{
$facing = BlockDataSerializer::readFacing($stateMeta & 0x07);