Fix crate NBT inconsistency in crates

Apparently, a mined crate used to differ from a freshly crafted one because the former didn't have any spiders in it. The latter? Neither.
This commit is contained in:
abel1502 2025-06-02 20:54:14 +03:00
parent 169f1666e7
commit 0f7c8b49f3
No known key found for this signature in database
GPG Key ID: 076926596A536338

View File

@ -152,8 +152,13 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti, IT
}
}
if(inv instanceof TileEntityCrateBase)
nbt.setBoolean("spiders", ((TileEntityCrateBase) inv).hasSpiders);
if(inv instanceof TileEntityCrateBase) {
TileEntityCrateBase crate = (TileEntityCrateBase) inv;
// Saves memory and ensures consistency between crafted crates and mined ones
if (crate.hasSpiders) {
nbt.setBoolean("spiders", true);
}
}
if(!nbt.hasNoTags()) {
drop.stackTagCompound = nbt;