Praise Rust, for the borrow-checker is a blessing to humanity.
I recently had to debug a Minecraft mod, and the entire time I felt scammed for my time because it was an issue that absolutely would not have existed if this was programmed using Rust. In Rust, when you own a struct or have a read-only reference to it, you can be absolutely 100% sure that the properties or anything about that struct will not change when you don't expect it. You can also be absolutely certain that when you pass a read-only reference to it to the outside world, that your struct will not be edited while the reference which you gave out to the world existed. In Java, there are no guarantees. Everyone just gives out references, willy-nilly, and has anyone edited any value during that time? Who knows? You don't, and it's somehow your fault if things crash. Better make defensive copies of every single thing because that's all you can do, make more work for the garbage collector.
For those interested, in the fabric version of Create, a contraption would crash the server when it turns back into blocks if you used shift+click to remove items from their chests/barrels. This is because the contraption keeps track of all inventory slots which are non empty, and it also maps items to any inventory slot which contains said item, which is fair enough. In order to accomplish this, whenever an inventory slot changes, they keep track of the old state of that inventory slot in order to know what references need updating without traversing all the inventories of the contraption. The problem is that for whatever reason, whenever you shift+click remove something from a contraption inventory, "old state" gets edited by someone somewhere I don't know, so that it turns into an empty item-stack, thus making the "old" and "new" state the same value, leading to the inventory slot mappings being incorrect, eventually resulting in an exception.
Also, fuck, Gradle, and fuck Maven, whoever designed the build+dependency management system for Java has caused so much unneeded human suffering. Next time you meet a Java developer, please give them some sympathy. I'm pretty sure they all need a hug, and I absolutely don't know how they can survive their day-to-day lives without crying themselves to sleep every night. Literally spent hours to build the mod with a local dependency instead from a remote repo.
my god awful fix for those interested.
Edit:
Someone rightfully suggested that the comments and log messages where too salty for a PR. Line 17 originally said "Because this isn't Rust so our entire universe is a lie". And line 75 originally said "lastStack.getCount() differs from this.lastStackCount!! This would never happen in Rustlang\