BlockFactory: added a hack for weird air blocks with non-zero damage values

I don't know what causes this to occur, but they should never have non-zero damage values, so we discard the metadata.
This commit is contained in:
Dylan K. Taylor 2018-04-09 16:35:14 +01:00
parent 646455f6e8
commit aa6666872a

View File

@ -439,6 +439,11 @@ class BlockFactory{
* @return int
*/
public static function toStaticRuntimeId(int $id, int $meta = 0) : int{
if($id === Block::AIR){
//TODO: HACK! (weird air blocks with non-zero damage values shouldn't turn into update! blocks)
$meta = 0;
}
$index = ($id << 4) | $meta;
if(!isset(self::$staticRuntimeIdMap[$index])){
self::registerMapping($rtId = ++self::$lastRuntimeId, $id, $meta);