fix: disabled multi block change, refactored

This commit is contained in:
əlemi 2023-11-02 05:32:50 +01:00
parent 989731574a
commit 56065d62f8
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -90,7 +90,9 @@ class GameWorld(Scaffold):
) )
) )
if self.cfg.getboolean("process_world", fallback=False): if not self.cfg.getboolean("process_world", fallback=False):
return
self.world = World() self.world = World()
@self.on_packet(PacketMapChunk) @self.on_packet(PacketMapChunk)
@ -106,6 +108,12 @@ 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):
return # holy shit this is LAME!
if hasattr(packet, "chunkCoordinates"):
chunk_x_off = (packet.chunkCoordinates & 0b1111111111111111111111) * 16
chunk_z_off = ((packet.chunkCoordinates >> 22) & 0b1111111111111111111111) * 16
chunk_y_off = ((packet.chunkCoordinates >> 44) & 0b11111111111111111111) * 16
else:
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: