diff --git a/server/main.py b/server/main.py index 352ec43..c76c35f 100644 --- a/server/main.py +++ b/server/main.py @@ -268,6 +268,8 @@ class YTDServerProtocol(ServerProtocol): # self.send_chunk(1,1) self.send_update_view_position(0,0) + # self.send_time_update(0,-6000) + def send_join_game(self): # Build up fields for "Join Game" packet entity_id = 0 @@ -354,6 +356,13 @@ class YTDServerProtocol(ServerProtocol): self.buff_type.pack_varint(z), ) + def send_time_update(self, server_age, world_time): + self.send_packet( + 'time_update', + self.buff_type.pack('l', server_age), + self.buff_type.pack('l', world_time), + ) + def packet_player_position(self, buff: Buffer_1_18_2): self.player.update_pos(*buff.unpack('ddd')) @@ -500,7 +509,7 @@ class YTDServerFactory(ServerFactory): def fix(self, x, z): blocks = [] for y in range(-64,325,16): - if not self.func(x*16,y,z*16): + if self.func(x*16,y,z*16) != BLOCK_EMPTY: blocks.append((x*16,y,z*16)) return blocks