TNT
TNT copied to clipboard
Identity comparison for air block.
Comparing with Block.AIR should be Block.AIR.compare(block), not an identity comparison.
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. It needs to save the block handler separately if present.