Example #1
0
 def get_player_position(self, uuid: str) -> object:
     position_tag: object = self.get_player_option(uuid, "Pos")
     return vector_3(position_tag[0].value, position_tag[1].value,
                     position_tag[2].value)
Example #2
0
 def get_spawn_position(self) -> object:
     return vector_3(self.get_option("SpawnX"), self.get_option("SpawnY"),
                     self.get_option("SpawnZ"))
Example #3
0
 def read_block_coordinates(self) -> object:
     return vector_3(float(self.read_signed_var_int()),
                     float(self.read_var_int()),
                     float(self.read_signed_var_int()))
Example #4
0
 def read_vector_3_float(self) -> object:
     return vector_3(self.read_float_le(), self.read_float_le(),
                     self.read_float_le())
Example #5
0
 def read_vector_3_unsigned_int(self) -> object:
     return vector_3(self.read_var_int(), self.read_var_int(),
                     self.read_var_int())
Example #6
0
 def send_start_game(self) -> None:
     if not self.world.has_player(self.identity):
         self.world.create_player(self.identity)
     self.position: object = self.world.get_player_position(self.identity)
     self.position.y += 1
     packet: object = start_game_packet()
     packet.entity_id = self.entity_id
     packet.entity_runtime_id = self.entity_id
     packet.player_gamemode = 1
     packet.spawn = self.position
     packet.rotation = vector_2(0, 0)
     packet.seed = 0
     packet.spawn_biome_type = 0
     packet.custom_biome_name = "plains"
     packet.dimension = 0
     packet.generator = 2
     packet.world_gamemode = self.world.get_world_gamemode()
     packet.difficulty = 0
     packet.world_spawn = vector_3(0, 4.0, 0)
     packet.disable_achivements = False
     packet.time = 0
     packet.edu_offer = 0
     packet.edu_features = False
     packet.edu_product_id = ""
     packet.rain_level = 0
     packet.lightning_level = 0
     packet.confirmed_platform_locked = False
     packet.multiplayer_game = True
     packet.lan_broadcasting = True
     packet.xbox_live_broadcast_mode = 4
     packet.platform_broadcast_mode = 4
     packet.enable_commands = True
     packet.require_texture_pack = False
     packet.game_rules = {}
     packet.experiments = []
     packet.has_used_experiments = False
     packet.bonus_chest = False
     packet.start_map = False
     packet.permission_level = 1
     packet.chunk_tick_range = 0
     packet.locked_behavior_pack = False
     packet.locked_texture_pack = False
     packet.from_locked_template = False
     packet.only_msa_gamer_tags = False
     packet.from_world_template = False
     packet.world_template_option_locked = True
     packet.only_old_villagers = False
     packet.game_version = mcbe_protocol_info.mcbe_version
     packet.limited_world_width = 0
     packet.limited_world_height = 0
     packet.new_nether = False
     packet.experimental_gamplay = False
     packet.level_id = ""
     packet.world_name = self.world.get_world_name()
     packet.premium_world_template_id = ""
     packet.trial = False
     packet.movement_type = 0
     packet.movement_rewind_size = 0
     packet.server_authoritative_block_breaking = False
     packet.current_tick = 0
     packet.enchantment_seed = 0
     packet.item_table = item_id_map
     packet.multiplayer_correlation_id = ""
     packet.server_authoritative_inventories = False
     packet.server_engine = "Podrum"
     packet.encode()
     self.send_packet(packet.data)