diff --git a/custom/networking/packets/clientbound/play/chunk_data.py b/custom/networking/packets/clientbound/play/chunk_data.py index 7cf12da..1192b78 100644 --- a/custom/networking/packets/clientbound/play/chunk_data.py +++ b/custom/networking/packets/clientbound/play/chunk_data.py @@ -11,12 +11,13 @@ from ....types import nbt class ChunkDataPacket(Packet): @staticmethod def get_id(context): - return 0x22 # FIXME + return 0x20 # FIXME packet_name = 'chunk data' fields = 'x', 'bit_mask_y', 'z', 'full_chunk' def read(self, file_object): + print('reading chunk') self.x = Integer.read(file_object) self.z = Integer.read(file_object) self.full_chunk = Boolean.read(file_object) @@ -24,7 +25,8 @@ class ChunkDataPacket(Packet): self.heightmaps = Nbt.read(file_object) self.biomes = [] if self.full_chunk: - for i in range(1024): + biomes_length = VarInt.read(file_object) + for i in range(biomes_length): self.biomes.append(Integer.read(file_object)) size = VarInt.read(file_object) self.data = file_object.read(size) diff --git a/start.py b/start.py index 075880f..7c3ba54 100644 --- a/start.py +++ b/start.py @@ -127,6 +127,8 @@ def main(): packet = serverbound.play.ClientStatusPacket() packet.action_id = serverbound.play.ClientStatusPacket.RESPAWN connection.write_packet(packet) + elif text == '!test': + print(chunks.get_block_at(91, 65, 57)) else: packet = serverbound.play.ChatPacket() packet.message = text