Display when the bot is loading chunks

This commit is contained in:
2021-02-23 21:37:14 +00:00
parent cf8677ee65
commit 1d8d473e26
2 changed files with 12 additions and 5 deletions

View File

@@ -44,6 +44,7 @@ class ChunksManager:
self.chunks = {}
self.biomes = {}
self.index = {}
self.loading = False
def handle_block(self, block_packet):
self.set_block_at(block_packet.location.x, block_packet.location.y, block_packet.location.z, block_packet.block_state_id)
@@ -74,6 +75,8 @@ class ChunksManager:
self.index[item_id].append(coords)
self.biomes[(chunk_packet.x, None, chunk_packet.z)] = chunk_packet.biomes # FIXME
if self.loading:
print('.', end='', flush=True)
def register(self, connection):
connection.register_packet_listener(self.handle_block, clientbound.play.BlockChangePacket)