fix: disabled multi block change, refactored
This commit is contained in:
parent
989731574a
commit
56065d62f8
1 changed files with 25 additions and 17 deletions
|
@ -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.on_packet(PacketMapChunk)
|
||||
|
@ -106,6 +108,12 @@ class GameWorld(Scaffold):
|
|||
|
||||
@self.on_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_z_off = packet.chunkZ * 16
|
||||
for entry in packet.records:
|
||||
|
|
Loading…
Reference in a new issue