Spectrum

Spectrum

2M Downloads

[BUG] Heartbound chest protection can be bypassed by ComputerCraft

umnikos opened this issue ยท 7 comments

commented

Describe the bug
One can simply wrap a heartbound chest like any other chest and pushItems items in and out of it.

To Reproduce

2025-01-16_00 32 46
Screenshot From 2025-01-16 00-33-00

Expected behavior
The chest should not be wrap-able at all.

Minecraft version
Minecraft 1.20.1
Fabric 0.16.9

Mod version
Spectrum: 1.8.1
CC:Tweaked: 1.114.2

commented

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.

commented

Yes, it works on other people's chests

commented

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.

commented

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.

commented

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

commented

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:

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);
commented

Not a bad idea. Thanks!