Skip to content

Commit

Permalink
Add 1.20.60 MP BC support
Browse files Browse the repository at this point in the history
  • Loading branch information
dries-c committed Mar 13, 2024
1 parent 17c59a2 commit 47b6fdd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/data/bedrock/BedrockDataFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ private function __construct(){
public const BLOCK_ID_TO_ITEM_ID_MAP_1_20_10_JSON = BEDROCK_DATA_PATH . '/block_id_to_item_id_map-1.20.10.json';
public const BLOCK_ID_TO_ITEM_ID_MAP_1_20_40_JSON = BEDROCK_DATA_PATH . '/block_id_to_item_id_map-1.20.40.json';
public const BLOCK_ID_TO_ITEM_ID_MAP_1_20_50_JSON = BEDROCK_DATA_PATH . '/block_id_to_item_id_map-1.20.50.json';
public const BLOCK_ID_TO_ITEM_ID_MAP_1_20_60_JSON = BEDROCK_DATA_PATH . '/block_id_to_item_id_map-1.20.60.json';
public const BLOCK_ID_TO_ITEM_ID_MAP_JSON = BEDROCK_DATA_PATH . '/block_id_to_item_id_map.json';
public const BLOCK_STATE_META_MAP_1_20_0_JSON = BEDROCK_DATA_PATH . '/block_state_meta_map-1.20.0.json';
public const BLOCK_STATE_META_MAP_1_20_10_JSON = BEDROCK_DATA_PATH . '/block_state_meta_map-1.20.10.json';
public const BLOCK_STATE_META_MAP_1_20_30_JSON = BEDROCK_DATA_PATH . '/block_state_meta_map-1.20.30.json';
public const BLOCK_STATE_META_MAP_1_20_40_JSON = BEDROCK_DATA_PATH . '/block_state_meta_map-1.20.40.json';
public const BLOCK_STATE_META_MAP_1_20_50_JSON = BEDROCK_DATA_PATH . '/block_state_meta_map-1.20.50.json';
public const BLOCK_STATE_META_MAP_1_20_60_JSON = BEDROCK_DATA_PATH . '/block_state_meta_map-1.20.60.json';
public const BLOCK_STATE_META_MAP_JSON = BEDROCK_DATA_PATH . '/block_state_meta_map.json';
public const CANONICAL_BLOCK_STATES_1_20_0_NBT = BEDROCK_DATA_PATH . '/canonical_block_states-1.20.0.nbt';
public const CANONICAL_BLOCK_STATES_1_20_10_NBT = BEDROCK_DATA_PATH . '/canonical_block_states-1.20.10.nbt';
public const CANONICAL_BLOCK_STATES_1_20_30_NBT = BEDROCK_DATA_PATH . '/canonical_block_states-1.20.30.nbt';
public const CANONICAL_BLOCK_STATES_1_20_40_NBT = BEDROCK_DATA_PATH . '/canonical_block_states-1.20.40.nbt';
public const CANONICAL_BLOCK_STATES_1_20_50_NBT = BEDROCK_DATA_PATH . '/canonical_block_states-1.20.50.nbt';
public const CANONICAL_BLOCK_STATES_1_20_60_NBT = BEDROCK_DATA_PATH . '/canonical_block_states-1.20.60.nbt';
public const CANONICAL_BLOCK_STATES_NBT = BEDROCK_DATA_PATH . '/canonical_block_states.nbt';
public const COMMAND_ARG_TYPES_JSON = BEDROCK_DATA_PATH . '/command_arg_types.json';
public const CREATIVEITEMS_JSON = BEDROCK_DATA_PATH . '/creativeitems.json';
Expand All @@ -64,11 +67,13 @@ private function __construct(){
public const R12_TO_CURRENT_BLOCK_MAP_1_20_30_BIN = BEDROCK_DATA_PATH . '/r12_to_current_block_map-1.20.30.bin';
public const R12_TO_CURRENT_BLOCK_MAP_1_20_40_BIN = BEDROCK_DATA_PATH . '/r12_to_current_block_map-1.20.40.bin';
public const R12_TO_CURRENT_BLOCK_MAP_1_20_50_BIN = BEDROCK_DATA_PATH . '/r12_to_current_block_map-1.20.50.bin';
public const R12_TO_CURRENT_BLOCK_MAP_1_20_60_BIN = BEDROCK_DATA_PATH . '/r12_to_current_block_map-1.20.60.bin';
public const R12_TO_CURRENT_BLOCK_MAP_BIN = BEDROCK_DATA_PATH . '/r12_to_current_block_map.bin';
public const R16_TO_CURRENT_ITEM_MAP_JSON = BEDROCK_DATA_PATH . '/r16_to_current_item_map.json';
public const REQUIRED_ITEM_LIST_1_20_0_JSON = BEDROCK_DATA_PATH . '/required_item_list-1.20.0.json';
public const REQUIRED_ITEM_LIST_1_20_10_JSON = BEDROCK_DATA_PATH . '/required_item_list-1.20.10.json';
public const REQUIRED_ITEM_LIST_1_20_40_JSON = BEDROCK_DATA_PATH . '/required_item_list-1.20.40.json';
public const REQUIRED_ITEM_LIST_1_20_50_JSON = BEDROCK_DATA_PATH . '/required_item_list-1.20.50.json';
public const REQUIRED_ITEM_LIST_1_20_60_JSON = BEDROCK_DATA_PATH . '/required_item_list-1.20.60.json';
public const REQUIRED_ITEM_LIST_JSON = BEDROCK_DATA_PATH . '/required_item_list.json';
}
1 change: 1 addition & 0 deletions src/data/bedrock/ItemTagToIdMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ final class ItemTagToIdMap{

private const PATHS = [
ProtocolInfo::CURRENT_PROTOCOL => "",
ProtocolInfo::PROTOCOL_1_20_60 => "",
ProtocolInfo::PROTOCOL_1_20_50 => "",
ProtocolInfo::PROTOCOL_1_20_40 => "-1.20.0",
ProtocolInfo::PROTOCOL_1_20_30 => "-1.20.0",
Expand Down
4 changes: 4 additions & 0 deletions src/network/mcpe/convert/BlockTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ final class BlockTranslator{
self::CANONICAL_BLOCK_STATES_PATH => '',
self::BLOCK_STATE_META_MAP_PATH => '',
],
ProtocolInfo::PROTOCOL_1_20_60 => [
self::CANONICAL_BLOCK_STATES_PATH => '-1.20.60',
self::BLOCK_STATE_META_MAP_PATH => '-1.20.60',
],
ProtocolInfo::PROTOCOL_1_20_50 => [
self::CANONICAL_BLOCK_STATES_PATH => '-1.20.50',
self::BLOCK_STATE_META_MAP_PATH => '-1.20.50',
Expand Down
2 changes: 2 additions & 0 deletions src/network/mcpe/convert/ItemTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ public function fromNetworkId(int $networkId, int $networkMeta, int $networkBloc

public static function getItemSchemaId(int $protocolId) : int{
return match($protocolId){
ProtocolInfo::PROTOCOL_1_20_70 => 171,

ProtocolInfo::PROTOCOL_1_20_60 => 161,

ProtocolInfo::PROTOCOL_1_20_50 => 151,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ final class ItemTypeDictionaryFromDataHelper{

private const PATHS = [
ProtocolInfo::CURRENT_PROTOCOL => "",
ProtocolInfo::PROTOCOL_1_20_60 => "-1.20.60",
ProtocolInfo::PROTOCOL_1_20_50 => "-1.20.50",
ProtocolInfo::PROTOCOL_1_20_40 => "-1.20.40",
ProtocolInfo::PROTOCOL_1_20_30 => "-1.20.40",
Expand Down

0 comments on commit 47b6fdd

Please sign in to comment.