Cleaned up shared rotation code, fixed quartz pillar rotation, added bone blocks

This commit is contained in:
Dylan K. Taylor
2017-08-25 13:06:16 +01:00
parent 8ce833bf74
commit 76e213ae73
5 changed files with 124 additions and 18 deletions

View File

@ -0,0 +1,39 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\block\utils;
use pocketmine\math\Vector3;
class PillarRotationHelper{
public static function getMetaFromFace(int $meta, int $face) : int{
$faces = [
Vector3::SIDE_DOWN => 0,
Vector3::SIDE_NORTH => 0x08,
Vector3::SIDE_WEST => 0x04,
];
return ($meta & 0x03) | $faces[$face & ~0x01];
}
}