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):
|
if not self.cfg.getboolean("process_world", fallback=True):
|
||||||
return
|
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)
|
@self.on_packet(PacketMapChunk)
|
||||||
async def map_chunk_cb(packet:PacketMapChunk):
|
async def map_chunk_cb(packet:PacketMapChunk):
|
||||||
assert isinstance(packet.bitMap, int)
|
assert isinstance(packet.bitMap, int)
|
||||||
|
@ -37,7 +37,7 @@ class GameWorld(Scaffold):
|
||||||
|
|
||||||
@self.on_packet(PacketMultiBlockChange)
|
@self.on_packet(PacketMultiBlockChange)
|
||||||
async def multi_block_change_cb(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_x_off = packet.chunkX * 16
|
||||||
chunk_z_off = packet.chunkZ * 16
|
chunk_z_off = packet.chunkZ * 16
|
||||||
for entry in packet.records:
|
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)
|
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'])
|
self.world.put_block(pos.x,pos.y, pos.z, entry['blockId'])
|
||||||
await self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, 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)
|
x = twos_comp((packet.chunkCoordinates >> 42) & 0x3FFFFF, 22)
|
||||||
z = twos_comp((packet.chunkCoordinates >> 20) & 0x3FFFFF, 22)
|
z = twos_comp((packet.chunkCoordinates >> 20) & 0x3FFFFF, 22)
|
||||||
y = twos_comp((packet.chunkCoordinates ) & 0xFFFFF , 20)
|
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)
|
self.world.put_block(pos.x, pos.y, pos.z, state)
|
||||||
await self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, state))
|
await self.run_callbacks(BlockUpdateEvent, BlockUpdateEvent(pos, state))
|
||||||
else:
|
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