This one's been bugging me for a while. I'm trying to build a NavMesh in my plugin and I need to check if Doors/Fence Gates and whatnot are open, but since Pocketmine uses the legacy Block Meta system instead of the new BlockStates, how would I efficiently check if the door at the node is open or close so I can mark the node as walkable/not walkable? It seems like a really bad way if I just went else if else if else if else if getDamage() == <Whatever the block meta that marks a door as open is>. And making this worse is that doors and gates have different orientations, meaning there's even more block metas to check
The way you've shown is the only way as far as I know. The block state is saved in the meta data, as you stated. It's possible that they're implementing BlockStates in PocketMine v4.0.0. I will confirm this, and edit this post asap.
:/ Looks like it's time for me to build an array of metadata values... again... Hopefully BlockStates come soon at least