Remove some remaining hardcoded meta maps

This commit is contained in:
Dylan K. Taylor
2018-09-16 18:00:16 +01:00
parent 8aab51c532
commit 31e4093882
2 changed files with 6 additions and 34 deletions

View File

@ -59,13 +59,7 @@ class ItemFrame extends Flowable{
}
public function onNearbyBlockChange() : void{
$sides = [
0 => Facing::WEST,
1 => Facing::EAST,
2 => Facing::NORTH,
3 => Facing::SOUTH
];
if(!$this->getSide($sides[$this->meta])->isSolid()){
if(!$this->getSide(Facing::opposite(5 - $this->meta))->isSolid()){
$this->level->useBreakOn($this);
}
}
@ -75,14 +69,7 @@ class ItemFrame extends Flowable{
return false;
}
$faces = [
Facing::NORTH => 3,
Facing::SOUTH => 2,
Facing::WEST => 1,
Facing::EAST => 0
];
$this->meta = $faces[$face];
$this->meta = 5 - $face;
if(parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player)){
Tile::createTile(Tile::ITEM_FRAME, $this->getLevel(), TileItemFrame::createNBT($this, $face, $item, $player));