Since commit 011ad78b42146725d93761473c7fd06698b2ca73 locked chests are affected by explosions just as with regular chests, dropping their contents. (Furthermore, the chest itself is dropped as a normal chest rather than a locked chest.)
I suspect that this is a bug.
I thought that was a feature...
The locked chest dropping as a normal chest (?) sounds like a bug, but the TNT explosion itself is the one that checks for protected nodes. I typically equate locked doors and chests, so I have to ask: Do the steel doors also explode normally? (And now I'm wondering about bones.)
TNT exploding a chest, locked chest, bookshelf, or vessel shelf, will drop the node, and its contents, by design.
@Fixer-007
The Minetest wiki page on Locked Chests states that a locked chest will survive explosions. This was the behaviour before 011ad78b42146725d93761473c7fd06698b2ca73.
@jastevenson303
I can confirm that locked doors are not removed in an explosion. Also the locked chest was not removed before 011ad78b42146725d93761473c7fd06698b2ca73. Looking at 011ad78b42146725d93761473c7fd06698b2ca73, line 1892 defines an empty on_blast callback for locked chests but this is overridden with the callback that was previously used for ordinary chests on line 1976. It appears that the callback was copied and pasted from the old code into the wrong place (note that in the old code it appeared directly after on_metadata_inventory_take as is the case here).
Regardless of previous behavior, how it stands now is inconsistent with locked doors and bones, both fresh and old. Bones and Steel Doors simply don't explode, while Locked Chests do.
https://www.twitch.tv/videos/171715042
And that's in an unprotected area. (Not to be confused with 'protected' chests, which in this case means locked). I'll test some more with protected areas and other users.
I remember blowing up player's bones with TNT. That was nice.
@jastevenson303 The point is that the behaviour has changed and was not intended to change (at least not as far as I can tell). Judging from the code introduced in 011ad78b42146725d93761473c7fd06698b2ca73, it definitely appears to be an error as on_blast is assigned an empty callback to protect against explosions and then overridden later on with the callback that's intended to be applied to non-locked chests.
Chests and shelves blowing up and dropping their contents was added as a feature. Are you saying that before 011ad78, only regular chests blew and not locked ones?
I agree locked chests should not blow up, as to match the behavior of steel doors (and bones). However, I actually wouldn't mind being able to blow up old, expired bones. And I can imagine blowing up the chest as a design choice, too. Let's ask @sofar
@jastevenson303 Yes, before 011ad78b42146725d93761473c7fd06698b2ca73 locked chests could not be blown up, only regular chests. I believe that this is the intended behaviour according to the wiki.
Most helpful comment
I thought that was a feature...