Item Drains crash the game when fluid containing items that do not leave remainders get inserted into them
f-raZ0R opened this issue ยท 2 comments
Context
I am not sure whether this is a case of "I am doing something that is bad practice, and there is a better way to implement such an item", or a case of "create shouldn't be doing it like this", but I can see exactly the part of code that causes this crash.
getAmount()
on the item remainder, without checking whether said item remainder... exists.
getAmount, does...
default long getAmount() { if (getItemVariant().isBlank()) { throw new IllegalStateException("Amount may not be queried when the current item variant is blank."); }
not like being given a nonexistent item
"wait a minute Athebyne what are you doing how did you implement a fluid containing item without a remainder. can you even do that"
here is my pr with said implementation. DaFuqs/Spectrum#516
Crash Report
of course it doesn't just return 0, that would be absurd...
needs to be fixed in create.