Skip to content

Commit

Permalink
Merge pull request #129 from JLyne/master
Browse files Browse the repository at this point in the history
1.18 Support
  • Loading branch information
dries007 authored Dec 4, 2021
2 parents 95fff30 + 3fd8065 commit 31d9317
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 4 deletions.
16 changes: 12 additions & 4 deletions examples/server_chat_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def player_joined(self):
max_players = 0
hashed_seed = 42
view_distance = 2
simulation_distance = 2
game_mode = 3
prev_game_mode = 3
is_hardcore = False
Expand All @@ -37,9 +38,7 @@ def player_joined(self):
dimension_type = dimension_types[self.protocol_version, "minecraft:overworld"]
data_pack = data_packs[self.protocol_version]

# Send "Join Game" packet
self.send_packet(
"join_game",
join_game = [
self.buff_type.pack("i?BB", entity_id, is_hardcore, game_mode, prev_game_mode),
self.buff_type.pack_varint(dimension_count),
self.buff_type.pack_string(dimension_name),
Expand All @@ -49,6 +48,15 @@ def player_joined(self):
self.buff_type.pack("q", hashed_seed),
self.buff_type.pack_varint(max_players),
self.buff_type.pack_varint(view_distance),
]

if self.protocol_version >= 757: # 1.18
join_game.append(self.buff_type.pack_varint(simulation_distance))

# Send "Join Game" packet
self.send_packet(
"join_game",
*join_game,
self.buff_type.pack("????", is_reduced_debug, is_respawn_screen, is_debug, is_flat))

# Send "Player Position and Look" packet
Expand Down Expand Up @@ -99,7 +107,7 @@ def send_chat(self, message, sender=None):
player.send_packet(
"chat_message",
player.buff_type.pack_chat(message),
player.buff_type.pack('B', 0),
player.buff_type.pack('b', 0),
player.buff_type.pack_uuid(sender))


Expand Down
Binary file added quarry/data/data_packs/0757_1.18.nbt
Binary file not shown.
166 changes: 166 additions & 0 deletions quarry/data/packets/0757_1.18.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
protocol_mode,packet_direction,packet_name
init,upstream,handshake
play,downstream,spawn_object
play,downstream,spawn_experience_orb
play,downstream,spawn_mob
play,downstream,spawn_painting
play,downstream,spawn_player
play,downstream,sculk_vibration_signal
play,downstream,animation
play,downstream,statistics
play,downstream,acknowledge_player_digging
play,downstream,block_break_animation
play,downstream,update_block_entity
play,downstream,block_action
play,downstream,block_change
play,downstream,boss_bar
play,downstream,server_difficulty
play,downstream,chat_message
play,downstream,clear_titles
play,downstream,tab_complete
play,downstream,declare_commands
play,downstream,close_window
play,downstream,window_items
play,downstream,window_property
play,downstream,set_slot
play,downstream,set_cooldown
play,downstream,plugin_message
play,downstream,named_sound_effect
play,downstream,disconnect
play,downstream,entity_status
play,downstream,explosion
play,downstream,unload_chunk
play,downstream,change_game_state
play,downstream,open_horse_window
play,downstream,initialize_world_border
play,downstream,keep_alive
play,downstream,chunk_data
play,downstream,effect
play,downstream,particle
play,downstream,update_light
play,downstream,join_game
play,downstream,map
play,downstream,trade_list
play,downstream,entity_relative_move
play,downstream,entity_look_and_relative_move
play,downstream,entity_look
play,downstream,vehicle_move
play,downstream,open_book
play,downstream,open_window
play,downstream,open_sign_editor
play,downstream,ping
play,downstream,craft_recipe_response
play,downstream,player_abilities
play,downstream,end_combat_event
play,downstream,enter_combat_event
play,downstream,death_combat_event
play,downstream,player_list_item
play,downstream,face_player
play,downstream,player_position_and_look
play,downstream,unlock_recipes
play,downstream,destroy_entities
play,downstream,remove_entity_effect
play,downstream,resource_pack_send
play,downstream,respawn
play,downstream,entity_head_look
play,downstream,multi_block_change
play,downstream,select_advancement_tab
play,downstream,action_bar
play,downstream,world_border_center
play,downstream,world_border_lerp_size
play,downstream,world_border_size
play,downstream,world_border_warning_delay
play,downstream,world_border_warning_reach
play,downstream,camera
play,downstream,held_item_change
play,downstream,update_view_position
play,downstream,update_view_distance
play,downstream,spawn_position
play,downstream,display_scoreboard
play,downstream,entity_metadata
play,downstream,attach_entity
play,downstream,entity_velocity
play,downstream,entity_equipment
play,downstream,set_experience
play,downstream,update_health
play,downstream,scoreboard_objective
play,downstream,set_passengers
play,downstream,teams
play,downstream,update_score
play,downstream,set_simulation_distance
play,downstream,set_title_subtitle
play,downstream,time_update
play,downstream,set_title_text
play,downstream,set_title_time
play,downstream,entity_sound_effect
play,downstream,sound_effect
play,downstream,stop_sound
play,downstream,player_list_header_footer
play,downstream,block_metadata_response
play,downstream,collect_item
play,downstream,entity_teleport
play,downstream,advancements
play,downstream,entity_properties
play,downstream,entity_effect
play,downstream,declare_recipes
play,downstream,tags
play,upstream,teleport_confirm
play,upstream,block_metadata_request
play,upstream,set_difficulty
play,upstream,chat_message
play,upstream,client_status
play,upstream,client_settings
play,upstream,tab_complete
play,upstream,confirm_transaction
play,upstream,click_window
play,upstream,close_window
play,upstream,plugin_message
play,upstream,edit_book
play,upstream,entity_metadata_request
play,upstream,use_entity
play,upstream,generate_structure
play,upstream,keep_alive
play,upstream,lock_difficulty
play,upstream,player_position
play,upstream,player_position_and_look
play,upstream,player_look
play,upstream,player
play,upstream,vehicle_move
play,upstream,steer_boat
play,upstream,pick_item
play,upstream,craft_recipe_request
play,upstream,player_abilities
play,upstream,player_digging
play,upstream,entity_action
play,upstream,steer_vehicle
play,upstream,pong
play,upstream,set_displayed_recipe
play,upstream,set_recipe_book_state
play,upstream,name_item
play,upstream,resource_pack_status
play,upstream,advancement_tab
play,upstream,select_trade
play,upstream,set_beacon_effect
play,upstream,held_item_change
play,upstream,update_command_block
play,upstream,update_command_block_minecart
play,upstream,creative_inventory_action
play,upstream,update_jigsaw_block
play,upstream,update_structure_block
play,upstream,update_sign
play,upstream,animation
play,upstream,spectate
play,upstream,player_block_placement
play,upstream,use_item
status,downstream,status_response
status,downstream,status_pong
status,upstream,status_request
status,upstream,status_ping
login,downstream,login_disconnect
login,downstream,login_encryption_request
login,downstream,login_success
login,downstream,login_set_compression
login,downstream,login_plugin_request
login,upstream,login_start
login,upstream,login_encryption_response
login,upstream,login_plugin_response

0 comments on commit 31d9317

Please sign in to comment.