Hex Casting

Hex Casting

6M Downloads

Clean up OpErase implementation

object-Object opened this issue ยท 1 comments

commented

This feels like a really scuffed way of checking if you can erase something, especially since "contains NULL" and "empty" are distinct states, so "can write NULL" doesn't necessarily imply "can make empty".

(hexHolder?.hasHex() == true) ||
(datumHolder?.writeIota(null, true) == true)
} ?: throw MishapBadOffhandItem.of(ItemStack.EMPTY.copy(), null, "eraseable") // TODO: hack

commented

hmm, I think "write null" (as in java null, not a NullIota()) is how the API currently implements erasing, so it makes sense that checking whether that's possible is how that currently works? but it would be very reasonable to consider "write null to erase" as not great practice