58 if(abs($player->getPosition()->x - $this->position->x) < 2 && abs($player->getPosition()->z - $this->position->z) < 2){
59 $y = $player->getEyePos()->y;
61 if($y - $this->position->y > 2){
62 $this->facing = Facing::UP;
63 }elseif($this->position->y - $y > 0){
64 $this->facing = Facing::DOWN;
66 $this->facing = Facing::opposite($player->getHorizontalFacing());
69 $this->facing = Facing::opposite($player->getHorizontalFacing());
73 return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
77 if($player instanceof
Player){
78 $barrel = $this->position->getWorld()->getTile($this->position);
79 if($barrel instanceof TileBarrel){
80 if(!$barrel->canOpenWith($item->getCustomName())){
84 $player->setCurrentWindow($barrel->getInventory());