
[BUG] Heartbound chest protection can be bypassed by ComputerCraft
umnikos opened this issue ยท 7 comments
Does this work if someone else places the turtle? IIRC, turtles store some information about the player who placed them and can use it to act as that player.
If that is the case I assume Turtles can also access chests that are using vanillas Lock Mechanism. Can you test that, please? In that case that will need to be fixed on Computercrafts side.
If that is the case I assume Turtles can also access chests that are using vanillas Lock Mechanism. Can you test that, please? In that case that will need to be fixed on Computercrafts side.
Indeed they can. Forwarding the issue, then.
Good to know, thank you!
I'll watch their issue. Once that is fixed they also will not be able to access heartbound chests anymore
So locked chests are a GUI-only mechanism โ they don't defend against inserting/removing items via automation (hoppers, CC turtles, etc...).
The issue here is that:
- CC:T finds inventories using Fabric's
ItemStorage
block lookup API, via thenull
side. We choose to use the null side so that you can interact with the whole inventory at once, rather than just a given side. - This gives us an
InventoryStorageImpl
โ as this just targets a normalInventory
, rather than aSidedInventory
. - This means
HeartboundChestBlockEntity
'scanInsert
/canExtract
are ignored.
I don't think any mod is really doing anything wrong here, just the combination of the three just ends up broken!
The "best" thing to do would be to change HeartboundChestBlockEntity
to not implement Inventory
in the first place, but obviously that's quite hard to given it inherits from SpectrumChestBlockEntity
. The easiest fix might just be to register an empty storage for the block โ something like this should work:
ItemStorage.SIDED.registerForBlockEntity((be, d) -> Storage.empty(), SpectrumBlockEntities.HEARTBOUND_CHEST);