-
-
Notifications
You must be signed in to change notification settings - Fork 3
Identity comparison for air block. #1
Comments
Does it matter? I thought it only mattered for blocks with data like rotations and stuff |
An air block with a different block handler or different nbt would not equal. Actually Block.withProperties("") would even be a different object |
those should be different in this case. Otherwise the nbt/handler will be removed |
Even with the exact same nbt, block handler, and properties, as long as it's a different block object, they will not be equal |
Block#compare uses ID by default, meaning two air blocks with different handler or NBT will be considered the same. Then the RLE being used on air here will remove the handler and NBT. You can use compare, but also need to check handler and nbt. |
@mworzala wouldn't you be ignoring block handlers? I don't see how you could serialise them? |
you should serialize the nbt + the name of the block handler if present. This does bring up a different problem with this implementation though, it A: assumes that there is a block handler if there is NBT on a block and B: uses the block name as the block handler. |
Comparing with Block.AIR should be Block.AIR.compare(block), not an identity comparison.
The text was updated successfully, but these errors were encountered: