Replaced more literal ints with Vector3 constants

This commit is contained in:
Dylan K. Taylor
2017-08-20 10:43:48 +01:00
parent e1d894057c
commit c394aea803
8 changed files with 28 additions and 28 deletions

View File

@ -71,13 +71,13 @@ class Torch extends Flowable{
public function place(Item $item, Block $block, Block $target, int $face, Vector3 $facePos, Player $player = null) : bool{
$below = $this->getSide(Vector3::SIDE_DOWN);
if($target->isTransparent() === false and $face !== 0){
if($target->isTransparent() === false and $face !== Vector3::SIDE_DOWN){
$faces = [
1 => 5,
2 => 4,
3 => 3,
4 => 2,
5 => 1,
Vector3::SIDE_UP => 5,
Vector3::SIDE_NORTH => 4,
Vector3::SIDE_SOUTH => 3,
Vector3::SIDE_WEST => 2,
Vector3::SIDE_EAST => 1,
];
$this->meta = $faces[$face];
$this->getLevel()->setBlock($block, $this, true, true);