Track reopened supply chests and fix API snapshots

This commit is contained in:
Tanner
2026-11-07 17:02:29 +00:00
parent 43b37b76f6
commit 9251edc36a
8 changed files with 280 additions and 7 deletions
+8 -1
View File
@@ -385,8 +385,15 @@ class LegacyGame:
self.g.connection.write_packet(packet)
def open_container(self, location):
location = tuple(int(value) for value in location)
bid = self.g.chunks.get_block_at(*location)
# TODO: check if block is a chest??
block_name = blocks.BLOCKS.get(bid)
if (block_name and block_name != 'ender_chest' and
(block_name == 'chest' or block_name.endswith('_chest'))):
self.g.pending_chest_open = {
'position': location,
'requested_at': time.monotonic(),
}
self.place_block(location, BlockFace.TOP)
def handle_window(self, packet):