Closed Wertik closed 2 years ago
Block's raw data is affected by several factors that are not considered as a Material distinguishing factor. For example the direction that stairs are facing is encoded in the data value. Or they're mixed, you can put down wood blocks differently so you have wood type and its direction mixed as a bit flag pattern.
I tried to dig deeper and played around with logs. Now I get it. It's a mess.
Thanks for the reply.
Description
I've noticed that methods like XBlock#isSimilar(Block, XMaterial) only compare the block type and ignore raw byte data on versions <1.13. I think it would be useful to either have a method that does this, or modify #isSimilar to do so.
Example: (Version 1.8)
With the current #isSimilar, this would match any type (color in this case) of wool. This seems like an unexpected behaviour given there's no alternative.
XBlock#getType(Block) seemed like a way to go, but it has been deprecated. I realize there's probably a good reason behind that. However, is there anything wrong about the following solution?
(XBlock#compareType for ex.)
This would match flattened types on 1.13, as well as raw byte data on <1.13.
I tried to do my research, if I missed anything I'm sorry.