From 0b4847fb9cffc8ea178bc8144e7f0d8eadb9d2d3 Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 2 Jun 2023 15:34:27 +0200 Subject: [PATCH] fix: why was I awaiting run_callbacks --- src/treepuncher/game/world.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/treepuncher/game/world.py b/src/treepuncher/game/world.py index 6e07ed0..98e1a61 100644 --- a/src/treepuncher/game/world.py +++ b/src/treepuncher/game/world.py @@ -33,7 +33,7 @@ class GameWorld(Scaffold): async def block_change_cb(packet:PacketBlockChange): self.world.put_block(packet.location[0], packet.location[1], packet.location[2], packet.type) pos = BlockPos(packet.location[0], packet.location[1], packet.location[2]) - await self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, packet.type)) + self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, packet.type)) @self.on_packet(PacketMultiBlockChange) async def multi_block_change_cb(packet:PacketMultiBlockChange): @@ -45,7 +45,7 @@ class GameWorld(Scaffold): z_off = entry['horizontalPos'] & 15 pos = BlockPos(x_off + chunk_x_off, entry['y'], z_off + chunk_z_off) self.world.put_block(pos.x,pos.y, pos.z, entry['blockId']) - await self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, entry['blockId'])) + self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, entry['blockId'])) elif self.dispatcher.proto < 760: x = twos_comp((packet.chunkCoordinates >> 42) & 0x3FFFFF, 22) z = twos_comp((packet.chunkCoordinates >> 20) & 0x3FFFFF, 22) @@ -57,6 +57,6 @@ class GameWorld(Scaffold): dy = ((loc & 0x0FFF) ) & 0x0F pos = BlockPos(16*x + dx, 16*y + dy, 16*z + dz) self.world.put_block(pos.x, pos.y, pos.z, state) - await self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, state)) + self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, state)) else: self.logger.error("Cannot process MultiBlockChange for protocol %d", self.dispatcher.proto)