mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Remove some remaining hardcoded meta maps
This commit is contained in:
@ -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));
|
||||
|
Reference in New Issue
Block a user