Track reopened supply chests and fix API snapshots
This commit is contained in:
+8
-1
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user