fix: wrong field
This commit is contained in:
parent
f920bbc838
commit
99a4a78dcb
1 changed files with 4 additions and 4 deletions
|
@ -21,7 +21,7 @@ class GameWorld(Scaffold):
|
|||
if not self.cfg.getboolean("process_world", fallback=True):
|
||||
return
|
||||
|
||||
if self.proto == 340: # Chunk parsing is only implemented for 1.12
|
||||
if self.dispatcher.proto == 340: # Chunk parsing is only implemented for 1.12
|
||||
@self.on_packet(PacketMapChunk)
|
||||
async def map_chunk_cb(packet:PacketMapChunk):
|
||||
assert isinstance(packet.bitMap, int)
|
||||
|
@ -37,7 +37,7 @@ class GameWorld(Scaffold):
|
|||
|
||||
@self.on_packet(PacketMultiBlockChange)
|
||||
async def multi_block_change_cb(packet:PacketMultiBlockChange):
|
||||
if self.proto < 751:
|
||||
if self.dispatcher.proto < 751:
|
||||
chunk_x_off = packet.chunkX * 16
|
||||
chunk_z_off = packet.chunkZ * 16
|
||||
for entry in packet.records:
|
||||
|
@ -46,7 +46,7 @@ class GameWorld(Scaffold):
|
|||
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']))
|
||||
elif self.proto < 760:
|
||||
elif self.dispatcher.proto < 760:
|
||||
x = twos_comp((packet.chunkCoordinates >> 42) & 0x3FFFFF, 22)
|
||||
z = twos_comp((packet.chunkCoordinates >> 20) & 0x3FFFFF, 22)
|
||||
y = twos_comp((packet.chunkCoordinates ) & 0xFFFFF , 20)
|
||||
|
@ -59,4 +59,4 @@ class GameWorld(Scaffold):
|
|||
self.world.put_block(pos.x, pos.y, pos.z, state)
|
||||
await self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, state))
|
||||
else:
|
||||
self.logger.error("Cannot process MultiBlockChange for protocol %d", self.proto)
|
||||
self.logger.error("Cannot process MultiBlockChange for protocol %d", self.dispatcher.proto)
|
||||
|
|
Loading…
Reference in a new issue