mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 02:56:17 -10:00
Older servers: join 1.21.9 and 1.21.10 servers
1.21.9 and 1.21.10 (protocol 773) get their packet and registry tables; generate_packet_id_adapter.py learns --rename for horse_screen_open, which 1.21.11 renamed mount_screen_open. Its packets are otherwise 1.21.11's; entity data takes 1.21.11's types for the bee's and the wolf's anger end (a LONG, an INT before) and an avatar's main arm (a HUMANOID_ARM, a BYTE before), and the serializers lack 1.21.11's zombie nautilus variant. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NbhTr6rUbVKx6iB2X73DNG
This commit is contained in:
1 parent
c23a2c48ea
commit
9027ef0a54
5 files changed
+534
-6
No files matched your search
@@ -8,6 +8,8 @@
|
||||
pub mod ids;
|
||||
pub mod session;
|
||||
mod translate;
|
||||
pub mod v1_21_10;
|
||||
mod v1_21_10_ids;
|
||||
pub mod v1_21_11;
|
||||
mod v1_21_11_ids;
|
||||
pub mod v26_1_2;
|
||||
@@ -32,11 +34,19 @@ pub enum ServerVersion {
|
||||
/// 26.1, 26.1.1 and 26.1.2: one protocol.
|
||||
V26_1,
|
||||
V1_21_11,
|
||||
/// 1.21.9 and 1.21.10: one protocol.
|
||||
V1_21_10,
|
||||
}
|
||||
|
||||
impl ServerVersion {
|
||||
/// Newest first.
|
||||
pub const ALL: [Self; 4] = [Self::Current, Self::V26_2, Self::V26_1, Self::V1_21_11];
|
||||
pub const ALL: [Self; 5] = [
|
||||
Self::Current,
|
||||
Self::V26_2,
|
||||
Self::V26_1,
|
||||
Self::V1_21_11,
|
||||
Self::V1_21_10,
|
||||
];
|
||||
|
||||
/// Whether this is `other` or an older release: the translation steps from `other` up apply.
|
||||
pub fn at_most(self, other: Self) -> bool {
|
||||
@@ -51,6 +61,7 @@ impl ServerVersion {
|
||||
Self::V26_2 => v26_2::PROTOCOL,
|
||||
Self::V26_1 => v26_1_2::PROTOCOL,
|
||||
Self::V1_21_11 => v1_21_11::PROTOCOL,
|
||||
Self::V1_21_10 => v1_21_10::PROTOCOL,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +72,7 @@ impl ServerVersion {
|
||||
Self::V26_2 => v26_2::NAME,
|
||||
Self::V26_1 => "26.1",
|
||||
Self::V1_21_11 => v1_21_11::NAME,
|
||||
Self::V1_21_10 => "1.21.10",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,11 +129,33 @@ impl ServerVersion {
|
||||
},
|
||||
..v1_21_11_ids::IDS
|
||||
};
|
||||
static V1_21_10: ids::Ids = ids::Ids {
|
||||
quirks: BEFORE_26_3,
|
||||
// As 1.21.11's, without the zombie nautilus variant 1.21.11 added after the chicken's.
|
||||
entity_data_serializer: ids::Remap::Runs {
|
||||
up: &[
|
||||
(0, 0, 22),
|
||||
(22, 23, 1),
|
||||
(23, 25, 4),
|
||||
(27, 30, 1),
|
||||
(28, 33, 9),
|
||||
],
|
||||
down: &[
|
||||
(0, 0, 22),
|
||||
(23, 22, 1),
|
||||
(25, 23, 4),
|
||||
(30, 27, 1),
|
||||
(33, 28, 9),
|
||||
],
|
||||
},
|
||||
..v1_21_10_ids::IDS
|
||||
};
|
||||
match self {
|
||||
Self::Current => None,
|
||||
Self::V26_2 => Some(&V26_2),
|
||||
Self::V26_1 => Some(&V26_1),
|
||||
Self::V1_21_11 => Some(&V1_21_11),
|
||||
Self::V1_21_10 => Some(&V1_21_10),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +168,8 @@ impl ServerVersion {
|
||||
(Self::V26_1, Direction::Serverbound) => v26_1_2::serverbound(state),
|
||||
(Self::V1_21_11, Direction::Clientbound) => v1_21_11::clientbound(state),
|
||||
(Self::V1_21_11, Direction::Serverbound) => v1_21_11::serverbound(state),
|
||||
(Self::V1_21_10, Direction::Clientbound) => v1_21_10::clientbound(state),
|
||||
(Self::V1_21_10, Direction::Serverbound) => v1_21_10::serverbound(state),
|
||||
};
|
||||
let mapped = *table.get(usize::try_from(id).ok()?)?;
|
||||
mapped.map(i32::from)
|
||||
@@ -184,7 +220,11 @@ mod tests {
|
||||
ServerVersion::from_protocol(774),
|
||||
Some(ServerVersion::V1_21_11)
|
||||
);
|
||||
assert_eq!(ServerVersion::from_protocol(773), None);
|
||||
assert_eq!(
|
||||
ServerVersion::from_protocol(773),
|
||||
Some(ServerVersion::V1_21_10)
|
||||
);
|
||||
assert_eq!(ServerVersion::from_protocol(772), None);
|
||||
assert!(ServerVersion::V26_1.at_most(ServerVersion::V26_2));
|
||||
assert!(!ServerVersion::V26_2.at_most(ServerVersion::V26_1));
|
||||
}
|
||||
|
||||
@@ -180,6 +180,9 @@ pub fn clientbound(
|
||||
(State::Play, cb::SET_ENTITY_DATA) if session.version.at_most(ServerVersion::V1_21_11) => {
|
||||
let mut p = decode_play(ids, id, payload)?;
|
||||
if let play::Clientbound::SetEntityData(d) = &mut p {
|
||||
if session.version.at_most(ServerVersion::V1_21_10) {
|
||||
v1_21_10::entity_data(session, d);
|
||||
}
|
||||
v1_21_11::entity_data(session, d);
|
||||
}
|
||||
strip_id(p.encode())
|
||||
@@ -624,6 +627,69 @@ fn animate(payload: &[u8]) -> Result<(i32, Vec<u8>)> {
|
||||
Ok((packet_ids::play::clientbound::ANIMATE, w.data))
|
||||
}
|
||||
|
||||
/// 1.21.10 (and 1.21.9) to 1.21.11.
|
||||
mod v1_21_10 {
|
||||
use super::*;
|
||||
|
||||
// 1.21.10's packets are laid out as 1.21.11's but for `horse_screen_open`, which 1.21.11 renamed
|
||||
// `mount_screen_open` (the id tables pair them): only entity data needs a step.
|
||||
use crate::entity_data::{Value, serializer};
|
||||
|
||||
/// Entity types (26.3 ids) whose entity data 1.21.11 changed.
|
||||
const BEE: i32 = 11;
|
||||
const WOLF: i32 = 152;
|
||||
const MANNEQUIN: i32 = 84;
|
||||
const PLAYER: i32 = 159;
|
||||
|
||||
/// 1.21.11 made the bee's and the wolf's anger end a LONG (an INT before) and an avatar's main arm a
|
||||
/// HUMANOID_ARM (a BYTE before, with the same 0 left, 1 right). Indexes as 1.21.10 numbers them.
|
||||
pub fn entity_data(session: &Session, data: &mut play::SetEntityData) {
|
||||
let Some(kind) = session.kinds.lock().unwrap().get(&data.id).copied() else {
|
||||
return;
|
||||
};
|
||||
for (index, ser, value) in &mut data.values {
|
||||
match (kind, *index, &*value) {
|
||||
(BEE, 18, Value::Int(v)) | (WOLF, 21, Value::Int(v)) => {
|
||||
*value = Value::Long(i64::from(*v));
|
||||
*ser = serializer::LONG;
|
||||
}
|
||||
(PLAYER | MANNEQUIN, 15, Value::Byte(v)) => {
|
||||
*value = Value::Id(i32::from(*v));
|
||||
*ser = serializer::HUMANOID_ARM;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn a_bee_s_anger_and_a_player_s_arm_take_1_21_11_s_types() {
|
||||
let session = Session::new(ServerVersion::V1_21_10);
|
||||
session.kinds.lock().unwrap().insert(1, BEE);
|
||||
session.kinds.lock().unwrap().insert(2, PLAYER);
|
||||
let mut bee = play::SetEntityData {
|
||||
id: 1,
|
||||
values: vec![(18, serializer::INT, Value::Int(400))],
|
||||
};
|
||||
entity_data(&session, &mut bee);
|
||||
assert_eq!(bee.values, vec![(18, serializer::LONG, Value::Long(400))]);
|
||||
let mut player = play::SetEntityData {
|
||||
id: 2,
|
||||
values: vec![(15, serializer::BYTE, Value::Byte(1))],
|
||||
};
|
||||
entity_data(&session, &mut player);
|
||||
assert_eq!(
|
||||
player.values,
|
||||
vec![(15, serializer::HUMANOID_ARM, Value::Id(1))]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 1.21.11 to 26.1.
|
||||
mod v1_21_11 {
|
||||
use super::*;
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
//! Packet ids of protocol 773 (1.21.10) against the pinned 777 (26.3).
|
||||
//! Generated by tools/generate_packet_id_adapter.py from both versions' packets reports;
|
||||
//! do not edit by hand.
|
||||
use crate::State;
|
||||
|
||||
pub const PROTOCOL: i32 = 773;
|
||||
pub const NAME: &str = "1.21.10";
|
||||
|
||||
#[rustfmt::skip]
|
||||
const HANDSHAKE_CLIENTBOUND: &[Option<u8>] = &[
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
const HANDSHAKE_SERVERBOUND: &[Option<u8>] = &[
|
||||
Some(0),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
const STATUS_CLIENTBOUND: &[Option<u8>] = &[
|
||||
Some(0), Some(1),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
const STATUS_SERVERBOUND: &[Option<u8>] = &[
|
||||
Some(0), Some(1),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
const LOGIN_CLIENTBOUND: &[Option<u8>] = &[
|
||||
Some(0), Some(1), Some(2), Some(3), Some(4), Some(5),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
const LOGIN_SERVERBOUND: &[Option<u8>] = &[
|
||||
Some(0), Some(1), Some(2), Some(3), Some(4),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
const CONFIGURATION_CLIENTBOUND: &[Option<u8>] = &[
|
||||
Some(0), Some(1), Some(2), Some(3), Some(4), Some(5), Some(6), Some(7), Some(8), Some(9), Some(11), Some(12),
|
||||
Some(13), Some(14), Some(15), Some(16), Some(17), Some(18), Some(19), Some(20),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
const CONFIGURATION_SERVERBOUND: &[Option<u8>] = &[
|
||||
Some(0), Some(1), Some(2), Some(3), Some(4), Some(5), Some(6), Some(7), Some(8), Some(9),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
const PLAY_CLIENTBOUND: &[Option<u8>] = &[
|
||||
Some(0), Some(1), Some(2), Some(3), Some(4), Some(5), Some(6), Some(7), Some(8), Some(9), Some(10), Some(11),
|
||||
Some(12), Some(13), Some(14), Some(15), Some(16), Some(17), Some(18), Some(19), Some(20), Some(21), Some(22), Some(23),
|
||||
Some(24), Some(25), Some(26), Some(27), Some(28), Some(29), Some(30), Some(31), Some(32), Some(33), Some(34), Some(35),
|
||||
Some(36), Some(38), Some(39), Some(41), Some(42), Some(43), Some(44), Some(45), Some(46), Some(47), Some(48), Some(49),
|
||||
Some(50), Some(52), Some(53), Some(54), Some(55), Some(56), Some(57), Some(58), Some(59), Some(60), Some(61), Some(62),
|
||||
Some(63), Some(64), Some(65), Some(66), Some(67), Some(68), Some(69), Some(70), Some(71), Some(72), Some(73), Some(74),
|
||||
Some(75), Some(76), Some(77), Some(78), Some(79), Some(80), Some(81), Some(82), Some(84), Some(85), Some(86), Some(87),
|
||||
Some(88), Some(89), Some(90), Some(91), Some(92), Some(93), Some(94), Some(95), Some(96), Some(97), Some(98), Some(99),
|
||||
Some(100), Some(101), Some(102), Some(103), Some(104), Some(105), Some(106), Some(107), Some(108), Some(109), Some(110), Some(111),
|
||||
Some(112), Some(113), Some(114), Some(115), Some(116), Some(117), Some(118), Some(119), Some(120), Some(121), Some(122), Some(124),
|
||||
Some(125), Some(126), Some(127), Some(128), Some(129), Some(130), Some(131), Some(132), Some(133), Some(134), Some(135), Some(136),
|
||||
Some(137), Some(138), Some(139), Some(140), Some(141), Some(142), Some(143),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
const PLAY_SERVERBOUND: &[Option<u8>] = &[
|
||||
Some(0), None, Some(1), Some(2), Some(3), Some(4), Some(5), Some(6), Some(7), Some(8), Some(9), Some(10),
|
||||
Some(11), Some(12), Some(13), Some(14), Some(15), Some(16), Some(17), Some(18), Some(19), Some(20), Some(21), Some(22),
|
||||
Some(23), Some(24), Some(25), Some(26), Some(27), Some(28), Some(29), Some(30), Some(31), Some(32), Some(33), Some(34),
|
||||
Some(35), Some(36), Some(37), Some(38), Some(39), Some(40), Some(41), Some(42), Some(43), Some(44), None, Some(45),
|
||||
Some(46), Some(47), Some(48), Some(49), Some(50), Some(51), Some(52), Some(53), Some(54), Some(55), None, Some(56),
|
||||
Some(57), Some(58), Some(59), None, Some(61), Some(62), Some(63), Some(64), Some(65),
|
||||
];
|
||||
/// For each id a 1.21.10 server sends in `state`, the pinned version's id of that packet.
|
||||
pub fn clientbound(state: State) -> &'static [Option<u8>] {
|
||||
match state {
|
||||
State::Handshake => HANDSHAKE_CLIENTBOUND,
|
||||
State::Status => STATUS_CLIENTBOUND,
|
||||
State::Login => LOGIN_CLIENTBOUND,
|
||||
State::Configuration => CONFIGURATION_CLIENTBOUND,
|
||||
State::Play => PLAY_CLIENTBOUND,
|
||||
}
|
||||
}
|
||||
/// For each pinned-version id Horizon sends in `state`, the id a 1.21.10 server knows it by.
|
||||
pub fn serverbound(state: State) -> &'static [Option<u8>] {
|
||||
match state {
|
||||
State::Handshake => HANDSHAKE_SERVERBOUND,
|
||||
State::Status => STATUS_SERVERBOUND,
|
||||
State::Login => LOGIN_SERVERBOUND,
|
||||
State::Configuration => CONFIGURATION_SERVERBOUND,
|
||||
State::Play => PLAY_SERVERBOUND,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,331 @@
|
||||
//! Registry ids of 1.21.10 against the pinned 26.3: block states and the registries
|
||||
//! the protocol sends by id. Generated by tools/generate_registry_id_adapter.py from both versions'
|
||||
//! registries and blocks reports; do not edit by hand.
|
||||
|
||||
/// Block states: 29671 in 1.21.10, 35723 pinned.
|
||||
pub const OLD_STATES: u32 = 29671;
|
||||
pub const PINNED_STATES: u32 = 35723;
|
||||
#[rustfmt::skip]
|
||||
pub const BLOCK_STATE_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 27), (27, 28, 58), (85, 88, 78), (163, 169, 35), (198, 207, 27), (225, 237, 27), (252, 267, 252), (504, 603, 877),
|
||||
(1381, 1680, 606), (1987, 2302, 65), (2052, 2368, 57), (2109, 3801, 13), (2122, 3815, 917), (3039, 4796, 2383), (5422, 7211, 276), (5698, 7495, 712),
|
||||
(6410, 8271, 136), (6546, 8415, 132), (6678, 8549, 811), (7489, 9424, 1803), (9292, 11235, 1146), (10438, 12382, 3), (10441, 12386, 248), (10689, 12658, 1481),
|
||||
(12170, 14219, 1012), (13182, 15237, 18), (13200, 15322, 6), (13206, 15255, 66), (13272, 16688, 6), (13278, 15321, 1), (13279, 15328, 259), (13538, 15619, 288),
|
||||
(13826, 15939, 544), (14370, 16547, 141), (14511, 16694, 333), (14844, 18403, 9641), (24485, 30517, 626), (25111, 31147, 2), (25113, 31152, 1), (25114, 31151, 1),
|
||||
(25115, 31150, 1), (25116, 31149, 1), (25117, 31160, 1), (25118, 31159, 1), (25119, 31158, 1), (25120, 31157, 1), (25121, 31164, 1), (25122, 31163, 1),
|
||||
(25123, 31162, 1), (25124, 31161, 1), (25125, 31405, 80), (25205, 31325, 80), (25285, 31245, 80), (25365, 31165, 80), (25445, 31823, 6), (25451, 31817, 6),
|
||||
(25457, 31811, 6), (25463, 31805, 6), (25469, 31143, 1), (25470, 31145, 1), (25471, 31144, 1), (25472, 31146, 1), (25473, 31156, 1), (25474, 31155, 1),
|
||||
(25475, 31154, 1), (25476, 31153, 1), (25477, 31725, 80), (25557, 31645, 80), (25637, 31565, 80), (25717, 31485, 80), (25797, 31847, 6), (25803, 31841, 6),
|
||||
(25809, 31835, 6), (25815, 31829, 6), (25821, 31853, 128), (25949, 32045, 64), (26013, 31981, 64), (26077, 32109, 128), (26205, 32301, 64), (26269, 32237, 64),
|
||||
(26333, 32365, 128), (26461, 32557, 64), (26525, 32493, 64), (26589, 32621, 128), (26717, 32813, 64), (26781, 32749, 64), (26845, 32877, 688), (27533, 33566, 20),
|
||||
(27553, 33565, 1), (27554, 33606, 2117),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const BLOCK_STATE_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 27), (28, 27, 58), (88, 85, 78), (169, 163, 35), (207, 198, 27), (237, 225, 27), (267, 252, 252), (603, 504, 877),
|
||||
(1680, 1381, 606), (2302, 1987, 65), (2368, 2052, 57), (3801, 2109, 13), (3815, 2122, 917), (4796, 3039, 2383), (7211, 5422, 276), (7495, 5698, 712),
|
||||
(8271, 6410, 136), (8415, 6546, 132), (8549, 6678, 811), (9424, 7489, 1803), (11235, 9292, 1146), (12382, 10438, 3), (12386, 10441, 248), (12658, 10689, 1481),
|
||||
(14219, 12170, 1012), (15237, 13182, 18), (15255, 13206, 66), (15321, 13278, 1), (15322, 13200, 6), (15328, 13279, 259), (15619, 13538, 288), (15939, 13826, 544),
|
||||
(16547, 14370, 141), (16688, 13272, 6), (16694, 14511, 333), (18403, 14844, 9641), (30517, 24485, 626), (31143, 25469, 1), (31144, 25471, 1), (31145, 25470, 1),
|
||||
(31146, 25472, 1), (31147, 25111, 2), (31149, 25116, 1), (31150, 25115, 1), (31151, 25114, 1), (31152, 25113, 1), (31153, 25476, 1), (31154, 25475, 1),
|
||||
(31155, 25474, 1), (31156, 25473, 1), (31157, 25120, 1), (31158, 25119, 1), (31159, 25118, 1), (31160, 25117, 1), (31161, 25124, 1), (31162, 25123, 1),
|
||||
(31163, 25122, 1), (31164, 25121, 1), (31165, 25365, 80), (31245, 25285, 80), (31325, 25205, 80), (31405, 25125, 80), (31485, 25717, 80), (31565, 25637, 80),
|
||||
(31645, 25557, 80), (31725, 25477, 80), (31805, 25463, 6), (31811, 25457, 6), (31817, 25451, 6), (31823, 25445, 6), (31829, 25815, 6), (31835, 25809, 6),
|
||||
(31841, 25803, 6), (31847, 25797, 6), (31853, 25821, 128), (31981, 26013, 64), (32045, 25949, 64), (32109, 26077, 128), (32237, 26269, 64), (32301, 26205, 64),
|
||||
(32365, 26333, 128), (32493, 26525, 64), (32557, 26461, 64), (32621, 26589, 128), (32749, 26781, 64), (32813, 26717, 64), (32877, 26845, 688), (33565, 27553, 1),
|
||||
(33566, 27533, 20), (33606, 27554, 2117),
|
||||
];
|
||||
/// `minecraft:item`: 1488 in 1.21.10, 1658 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const ITEM_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 26), (26, 53, 19), (45, 73, 13), (58, 87, 34), (92, 128, 3), (95, 121, 3), (98, 131, 4), (102, 139, 4),
|
||||
(106, 147, 4), (110, 155, 4), (114, 124, 4), (118, 135, 4), (122, 143, 4), (126, 151, 4), (130, 159, 13), (143, 173, 14),
|
||||
(157, 188, 11), (168, 200, 12), (180, 213, 11), (191, 227, 14), (205, 242, 24), (229, 298, 1), (230, 300, 19), (249, 320, 30),
|
||||
(279, 351, 34), (313, 386, 40), (353, 427, 97), (450, 525, 180), (630, 737, 130), (760, 868, 16), (776, 885, 13), (789, 899, 21),
|
||||
(810, 921, 20), (830, 942, 51), (881, 995, 116), (997, 1112, 12), (1009, 1125, 15), (1024, 1141, 29), (1053, 1186, 49), (1102, 1236, 3),
|
||||
(1105, 1255, 25), (1130, 1291, 1), (1131, 1313, 1), (1132, 1301, 1), (1133, 1292, 2), (1135, 1354, 1), (1136, 1323, 1), (1137, 1339, 1),
|
||||
(1138, 1288, 1), (1139, 1284, 1), (1140, 1337, 1), (1141, 1280, 1), (1142, 1302, 1), (1143, 1317, 1), (1144, 1281, 1), (1145, 1341, 1),
|
||||
(1146, 1303, 1), (1147, 1285, 1), (1148, 1325, 1), (1149, 1342, 1), (1150, 1364, 3), (1153, 1349, 1), (1154, 1294, 1), (1155, 1304, 1),
|
||||
(1156, 1355, 2), (1158, 1305, 1), (1159, 1295, 1), (1160, 1343, 1), (1161, 1357, 1), (1162, 1286, 1), (1163, 1326, 1), (1164, 1318, 1),
|
||||
(1165, 1296, 1), (1166, 1358, 1), (1167, 1314, 1), (1168, 1287, 1), (1169, 1297, 2), (1171, 1289, 1), (1172, 1344, 1), (1173, 1282, 1),
|
||||
(1174, 1359, 2), (1176, 1350, 1), (1177, 1299, 1), (1178, 1307, 1), (1179, 1300, 1), (1180, 1351, 1), (1181, 1308, 1), (1182, 1283, 1),
|
||||
(1183, 1367, 1), (1184, 1345, 1), (1185, 1328, 2), (1187, 1346, 1), (1188, 1315, 1), (1189, 1319, 1), (1190, 1338, 1), (1191, 1309, 1),
|
||||
(1192, 1330, 1), (1193, 1361, 1), (1194, 1310, 1), (1195, 1320, 1), (1196, 1311, 2), (1198, 1353, 1), (1199, 1321, 1), (1200, 1352, 1),
|
||||
(1201, 1322, 1), (1202, 1347, 2), (1204, 1331, 2), (1206, 1290, 1), (1207, 1362, 1), (1208, 1340, 1), (1209, 1333, 2), (1211, 1336, 1),
|
||||
(1212, 1363, 1), (1213, 1368, 42), (1255, 1411, 36), (1291, 1454, 9), (1300, 1464, 21), (1321, 1490, 82), (1403, 1573, 85),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const ITEM_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 26), (53, 26, 19), (73, 45, 13), (87, 58, 34), (121, 95, 3), (124, 114, 4), (128, 92, 3), (131, 98, 4),
|
||||
(135, 118, 4), (139, 102, 4), (143, 122, 4), (147, 106, 4), (151, 126, 4), (155, 110, 4), (159, 130, 13), (173, 143, 14),
|
||||
(188, 157, 11), (200, 168, 12), (213, 180, 11), (227, 191, 14), (242, 205, 24), (298, 229, 1), (300, 230, 19), (320, 249, 30),
|
||||
(351, 279, 34), (386, 313, 40), (427, 353, 97), (525, 450, 180), (737, 630, 130), (868, 760, 16), (885, 776, 13), (899, 789, 21),
|
||||
(921, 810, 20), (942, 830, 51), (995, 881, 116), (1112, 997, 12), (1125, 1009, 15), (1141, 1024, 29), (1186, 1053, 49), (1236, 1102, 3),
|
||||
(1255, 1105, 25), (1280, 1141, 1), (1281, 1144, 1), (1282, 1173, 1), (1283, 1182, 1), (1284, 1139, 1), (1285, 1147, 1), (1286, 1162, 1),
|
||||
(1287, 1168, 1), (1288, 1138, 1), (1289, 1171, 1), (1290, 1206, 1), (1291, 1130, 1), (1292, 1133, 2), (1294, 1154, 1), (1295, 1159, 1),
|
||||
(1296, 1165, 1), (1297, 1169, 2), (1299, 1177, 1), (1300, 1179, 1), (1301, 1132, 1), (1302, 1142, 1), (1303, 1146, 1), (1304, 1155, 1),
|
||||
(1305, 1158, 1), (1307, 1178, 1), (1308, 1181, 1), (1309, 1191, 1), (1310, 1194, 1), (1311, 1196, 2), (1313, 1131, 1), (1314, 1167, 1),
|
||||
(1315, 1188, 1), (1317, 1143, 1), (1318, 1164, 1), (1319, 1189, 1), (1320, 1195, 1), (1321, 1199, 1), (1322, 1201, 1), (1323, 1136, 1),
|
||||
(1325, 1148, 1), (1326, 1163, 1), (1328, 1185, 2), (1330, 1192, 1), (1331, 1204, 2), (1333, 1209, 2), (1336, 1211, 1), (1337, 1140, 1),
|
||||
(1338, 1190, 1), (1339, 1137, 1), (1340, 1208, 1), (1341, 1145, 1), (1342, 1149, 1), (1343, 1160, 1), (1344, 1172, 1), (1345, 1184, 1),
|
||||
(1346, 1187, 1), (1347, 1202, 2), (1349, 1153, 1), (1350, 1176, 1), (1351, 1180, 1), (1352, 1200, 1), (1353, 1198, 1), (1354, 1135, 1),
|
||||
(1355, 1156, 2), (1357, 1161, 1), (1358, 1166, 1), (1359, 1174, 2), (1361, 1193, 1), (1362, 1207, 1), (1363, 1212, 1), (1364, 1150, 3),
|
||||
(1367, 1183, 1), (1368, 1213, 42), (1411, 1255, 36), (1454, 1291, 9), (1464, 1300, 21), (1490, 1321, 82), (1573, 1403, 85),
|
||||
];
|
||||
/// `minecraft:entity_type`: 153 in 1.21.10, 161 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const ENTITY_TYPE_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 20), (20, 21, 12), (32, 34, 55), (87, 90, 8), (95, 99, 7), (102, 108, 25), (127, 134, 22), (149, 157, 4),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const ENTITY_TYPE_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 20), (21, 20, 12), (34, 32, 55), (90, 87, 8), (99, 95, 7), (108, 102, 25), (134, 127, 22), (157, 149, 4),
|
||||
];
|
||||
/// `minecraft:particle_type`: 115 in 1.21.10, 128 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const PARTICLE_TYPE_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 4), (4, 11, 32), (36, 46, 14), (50, 62, 65),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const PARTICLE_TYPE_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 4), (11, 4, 32), (46, 36, 14), (62, 50, 65),
|
||||
];
|
||||
/// `minecraft:sound_event`: 1771 in 1.21.10, 1991 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const SOUND_EVENT_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 79), (79, 81, 27), (106, 117, 111), (217, 229, 6), (223, 236, 13), (236, 260, 19), (255, 288, 2), (257, 292, 2),
|
||||
(259, 290, 1), (260, 294, 1), (261, 291, 1), (262, 295, 2), (264, 306, 44), (308, 356, 1), (309, 358, 1), (310, 352, 1),
|
||||
(311, 357, 1), (312, 354, 1), (313, 362, 87), (400, 450, 1), (401, 452, 1), (402, 451, 1), (403, 449, 1), (404, 453, 1),
|
||||
(405, 458, 34), (439, 496, 261), (700, 759, 95), (795, 855, 1), (796, 857, 3), (799, 861, 1), (800, 863, 1), (801, 865, 2),
|
||||
(803, 868, 2), (805, 871, 2), (807, 874, 86), (893, 963, 74), (967, 1038, 45), (1012, 1084, 1), (1013, 1097, 78), (1091, 1179, 30),
|
||||
(1121, 1213, 8), (1129, 1222, 14), (1143, 1237, 18), (1161, 1257, 8), (1169, 1272, 1), (1170, 1274, 1), (1171, 1273, 1), (1172, 1265, 2),
|
||||
(1174, 1284, 94), (1268, 1387, 143), (1411, 1378, 9), (1420, 1536, 77), (1497, 1619, 176), (1673, 1796, 3), (1676, 1803, 2), (1678, 1807, 74),
|
||||
(1752, 1882, 1), (1753, 1884, 3), (1756, 1899, 15),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const SOUND_EVENT_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 79), (81, 79, 27), (117, 106, 111), (229, 217, 6), (236, 223, 13), (260, 236, 19), (288, 255, 2), (290, 259, 1),
|
||||
(291, 261, 1), (292, 257, 2), (294, 260, 1), (295, 262, 2), (306, 264, 44), (352, 310, 1), (354, 312, 1), (356, 308, 1),
|
||||
(357, 311, 1), (358, 309, 1), (362, 313, 87), (449, 403, 1), (450, 400, 1), (451, 402, 1), (452, 401, 1), (453, 404, 1),
|
||||
(458, 405, 34), (496, 439, 261), (759, 700, 95), (855, 795, 1), (857, 796, 3), (861, 799, 1), (863, 800, 1), (865, 801, 2),
|
||||
(868, 803, 2), (871, 805, 2), (874, 807, 86), (963, 893, 74), (1038, 967, 45), (1084, 1012, 1), (1097, 1013, 78), (1179, 1091, 30),
|
||||
(1213, 1121, 8), (1222, 1129, 14), (1237, 1143, 18), (1257, 1161, 8), (1265, 1172, 2), (1272, 1169, 1), (1273, 1171, 1), (1274, 1170, 1),
|
||||
(1284, 1174, 94), (1378, 1411, 9), (1387, 1268, 143), (1536, 1420, 77), (1619, 1497, 176), (1796, 1673, 3), (1803, 1676, 2), (1807, 1678, 74),
|
||||
(1882, 1752, 1), (1884, 1753, 3), (1899, 1756, 15),
|
||||
];
|
||||
/// `minecraft:data_component_type`: 96 in 1.21.10, 122 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const DATA_COMPONENT_TYPE_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 5), (5, 6, 1), (6, 9, 21), (27, 31, 7), (34, 45, 1), (35, 47, 1), (37, 48, 32), (69, 81, 3),
|
||||
(72, 88, 13), (85, 102, 1), (86, 104, 1), (87, 107, 6), (93, 114, 3),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const DATA_COMPONENT_TYPE_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 5), (6, 5, 1), (9, 6, 21), (31, 27, 7), (45, 34, 1), (47, 35, 1), (48, 37, 32), (81, 69, 3),
|
||||
(88, 72, 13), (102, 85, 1), (104, 86, 1), (107, 87, 6), (114, 93, 3),
|
||||
];
|
||||
/// `minecraft:command_argument_type`: 57 in 1.21.10, 62 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const COMMAND_ARGUMENT_TYPE_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 55), (55, 58, 1), (56, 61, 1),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const COMMAND_ARGUMENT_TYPE_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 55), (58, 55, 1), (61, 56, 1),
|
||||
];
|
||||
/// `minecraft:custom_stat`: 76 in 1.21.10, 78 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const CUSTOM_STAT_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 22), (22, 23, 38), (60, 62, 16),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const CUSTOM_STAT_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 22), (23, 22, 38), (62, 60, 16),
|
||||
];
|
||||
/// `minecraft:map_decoration_type`: 35 in 1.21.10, 40 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const MAP_DECORATION_TYPE_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 35),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const MAP_DECORATION_TYPE_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 35),
|
||||
];
|
||||
/// `minecraft:block`: 1166 in 1.21.10, 1286 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const BLOCK_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 23), (23, 24, 11), (34, 36, 24), (58, 61, 12), (70, 74, 9), (79, 84, 9), (88, 94, 9), (97, 106, 29),
|
||||
(126, 136, 8), (134, 145, 22), (156, 199, 2), (158, 202, 31), (189, 234, 29), (218, 264, 14), (232, 279, 12), (244, 292, 10),
|
||||
(254, 303, 15), (269, 319, 55), (324, 375, 72), (396, 448, 24), (420, 473, 3), (423, 477, 27), (450, 505, 69), (519, 575, 87),
|
||||
(606, 663, 3), (609, 678, 1), (610, 666, 11), (621, 716, 1), (622, 677, 1), (623, 679, 11), (634, 691, 9), (643, 701, 9),
|
||||
(652, 711, 5), (657, 717, 67), (724, 816, 272), (996, 1115, 13), (1009, 1132, 2), (1011, 1137, 1), (1012, 1136, 1), (1013, 1135, 1),
|
||||
(1014, 1134, 1), (1015, 1145, 1), (1016, 1144, 1), (1017, 1143, 1), (1018, 1142, 1), (1019, 1149, 1), (1020, 1148, 1), (1021, 1147, 1),
|
||||
(1022, 1146, 1), (1023, 1153, 1), (1024, 1152, 1), (1025, 1151, 1), (1026, 1150, 1), (1027, 1161, 1), (1028, 1160, 1), (1029, 1159, 1),
|
||||
(1030, 1158, 1), (1031, 1128, 1), (1032, 1130, 1), (1033, 1129, 1), (1034, 1131, 1), (1035, 1141, 1), (1036, 1140, 1), (1037, 1139, 1),
|
||||
(1038, 1138, 1), (1039, 1157, 1), (1040, 1156, 1), (1041, 1155, 1), (1042, 1154, 1), (1043, 1165, 1), (1044, 1164, 1), (1045, 1163, 1),
|
||||
(1046, 1162, 1), (1047, 1166, 2), (1049, 1169, 1), (1050, 1168, 1), (1051, 1170, 2), (1053, 1173, 1), (1054, 1172, 1), (1055, 1174, 2),
|
||||
(1057, 1177, 1), (1058, 1176, 1), (1059, 1178, 2), (1061, 1181, 1), (1062, 1180, 1), (1063, 1182, 40), (1103, 1223, 1), (1104, 1222, 1),
|
||||
(1105, 1225, 61),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const BLOCK_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 23), (24, 23, 11), (36, 34, 24), (61, 58, 12), (74, 70, 9), (84, 79, 9), (94, 88, 9), (106, 97, 29),
|
||||
(136, 126, 8), (145, 134, 22), (199, 156, 2), (202, 158, 31), (234, 189, 29), (264, 218, 14), (279, 232, 12), (292, 244, 10),
|
||||
(303, 254, 15), (319, 269, 55), (375, 324, 72), (448, 396, 24), (473, 420, 3), (477, 423, 27), (505, 450, 69), (575, 519, 87),
|
||||
(663, 606, 3), (666, 610, 11), (677, 622, 1), (678, 609, 1), (679, 623, 11), (691, 634, 9), (701, 643, 9), (711, 652, 5),
|
||||
(716, 621, 1), (717, 657, 67), (816, 724, 272), (1115, 996, 13), (1128, 1031, 1), (1129, 1033, 1), (1130, 1032, 1), (1131, 1034, 1),
|
||||
(1132, 1009, 2), (1134, 1014, 1), (1135, 1013, 1), (1136, 1012, 1), (1137, 1011, 1), (1138, 1038, 1), (1139, 1037, 1), (1140, 1036, 1),
|
||||
(1141, 1035, 1), (1142, 1018, 1), (1143, 1017, 1), (1144, 1016, 1), (1145, 1015, 1), (1146, 1022, 1), (1147, 1021, 1), (1148, 1020, 1),
|
||||
(1149, 1019, 1), (1150, 1026, 1), (1151, 1025, 1), (1152, 1024, 1), (1153, 1023, 1), (1154, 1042, 1), (1155, 1041, 1), (1156, 1040, 1),
|
||||
(1157, 1039, 1), (1158, 1030, 1), (1159, 1029, 1), (1160, 1028, 1), (1161, 1027, 1), (1162, 1046, 1), (1163, 1045, 1), (1164, 1044, 1),
|
||||
(1165, 1043, 1), (1166, 1047, 2), (1168, 1050, 1), (1169, 1049, 1), (1170, 1051, 2), (1172, 1054, 1), (1173, 1053, 1), (1174, 1055, 2),
|
||||
(1176, 1058, 1), (1177, 1057, 1), (1178, 1059, 2), (1180, 1062, 1), (1181, 1061, 1), (1182, 1063, 40), (1222, 1104, 1), (1223, 1103, 1),
|
||||
(1225, 1105, 61),
|
||||
];
|
||||
/// `minecraft:block_entity_type`: 49 in 1.21.10, 49 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const BLOCK_ENTITY_TYPE_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 25), (26, 25, 23),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const BLOCK_ENTITY_TYPE_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 25), (25, 26, 23),
|
||||
];
|
||||
/// `minecraft:mob_effect`: 39 in 1.21.10, 40 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const MOB_EFFECT_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 39),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const MOB_EFFECT_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 39),
|
||||
];
|
||||
/// `minecraft:attribute`: 35 in 1.21.10, 40 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const ATTRIBUTE_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 1, 5), (5, 7, 2), (7, 10, 7), (14, 18, 9), (23, 28, 12),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const ATTRIBUTE_DOWN: &[(u16, u16, u16)] = &[
|
||||
(1, 0, 5), (7, 5, 2), (10, 7, 7), (18, 14, 9), (28, 23, 12),
|
||||
];
|
||||
/// `minecraft:game_event`: 60 in 1.21.10, 61 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const GAME_EVENT_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 9), (9, 10, 51),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const GAME_EVENT_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 9), (10, 9, 51),
|
||||
];
|
||||
/// `minecraft:recipe_serializer`: 22 in 1.21.10, 22 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const RECIPE_SERIALIZER_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 2), (3, 6, 1), (5, 7, 4), (10, 11, 2), (12, 4, 1), (13, 13, 7), (20, 21, 1), (21, 5, 1),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const RECIPE_SERIALIZER_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 2), (4, 12, 1), (5, 21, 1), (6, 3, 1), (7, 5, 4), (11, 10, 2), (13, 13, 7), (21, 20, 1),
|
||||
];
|
||||
/// `minecraft:slot_display`: 8 in 1.21.10, 11 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const SLOT_DISPLAY_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 2), (2, 4, 3), (5, 8, 3),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const SLOT_DISPLAY_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 2), (4, 2, 3), (8, 5, 3),
|
||||
];
|
||||
/// `minecraft:enchantment_effect_component_type`: 30 in 1.21.10, 31 pinned.
|
||||
#[rustfmt::skip]
|
||||
pub const ENCHANTMENT_EFFECT_COMPONENT_TYPE_UP: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 7), (7, 8, 2), (9, 24, 1), (10, 10, 14), (24, 25, 6),
|
||||
];
|
||||
#[rustfmt::skip]
|
||||
pub const ENCHANTMENT_EFFECT_COMPONENT_TYPE_DOWN: &[(u16, u16, u16)] = &[
|
||||
(0, 0, 7), (8, 7, 2), (10, 10, 14), (24, 9, 1), (25, 24, 6),
|
||||
];
|
||||
/// Every table above, as the adapter reads them.
|
||||
pub const IDS: super::ids::Ids = super::ids::Ids {
|
||||
quirks: super::ids::Quirks::NONE,
|
||||
states: (OLD_STATES, PINNED_STATES),
|
||||
block_state: super::ids::Remap::Runs {
|
||||
up: BLOCK_STATE_UP,
|
||||
down: BLOCK_STATE_DOWN,
|
||||
},
|
||||
item: super::ids::Remap::Runs {
|
||||
up: ITEM_UP,
|
||||
down: ITEM_DOWN,
|
||||
},
|
||||
entity_type: super::ids::Remap::Runs {
|
||||
up: ENTITY_TYPE_UP,
|
||||
down: ENTITY_TYPE_DOWN,
|
||||
},
|
||||
particle_type: super::ids::Remap::Runs {
|
||||
up: PARTICLE_TYPE_UP,
|
||||
down: PARTICLE_TYPE_DOWN,
|
||||
},
|
||||
sound_event: super::ids::Remap::Runs {
|
||||
up: SOUND_EVENT_UP,
|
||||
down: SOUND_EVENT_DOWN,
|
||||
},
|
||||
data_component_type: super::ids::Remap::Runs {
|
||||
up: DATA_COMPONENT_TYPE_UP,
|
||||
down: DATA_COMPONENT_TYPE_DOWN,
|
||||
},
|
||||
command_argument_type: super::ids::Remap::Runs {
|
||||
up: COMMAND_ARGUMENT_TYPE_UP,
|
||||
down: COMMAND_ARGUMENT_TYPE_DOWN,
|
||||
},
|
||||
custom_stat: super::ids::Remap::Runs {
|
||||
up: CUSTOM_STAT_UP,
|
||||
down: CUSTOM_STAT_DOWN,
|
||||
},
|
||||
map_decoration_type: super::ids::Remap::Runs {
|
||||
up: MAP_DECORATION_TYPE_UP,
|
||||
down: MAP_DECORATION_TYPE_DOWN,
|
||||
},
|
||||
block: super::ids::Remap::Runs {
|
||||
up: BLOCK_UP,
|
||||
down: BLOCK_DOWN,
|
||||
},
|
||||
block_entity_type: super::ids::Remap::Runs {
|
||||
up: BLOCK_ENTITY_TYPE_UP,
|
||||
down: BLOCK_ENTITY_TYPE_DOWN,
|
||||
},
|
||||
menu: super::ids::Remap::Same,
|
||||
mob_effect: super::ids::Remap::Runs {
|
||||
up: MOB_EFFECT_UP,
|
||||
down: MOB_EFFECT_DOWN,
|
||||
},
|
||||
attribute: super::ids::Remap::Runs {
|
||||
up: ATTRIBUTE_UP,
|
||||
down: ATTRIBUTE_DOWN,
|
||||
},
|
||||
stat_type: super::ids::Remap::Same,
|
||||
fluid: super::ids::Remap::Same,
|
||||
game_event: super::ids::Remap::Runs {
|
||||
up: GAME_EVENT_UP,
|
||||
down: GAME_EVENT_DOWN,
|
||||
},
|
||||
recipe_serializer: super::ids::Remap::Runs {
|
||||
up: RECIPE_SERIALIZER_UP,
|
||||
down: RECIPE_SERIALIZER_DOWN,
|
||||
},
|
||||
slot_display: super::ids::Remap::Runs {
|
||||
up: SLOT_DISPLAY_UP,
|
||||
down: SLOT_DISPLAY_DOWN,
|
||||
},
|
||||
recipe_display: super::ids::Remap::Same,
|
||||
recipe_book_category: super::ids::Remap::Same,
|
||||
villager_type: super::ids::Remap::Same,
|
||||
villager_profession: super::ids::Remap::Same,
|
||||
position_source_type: super::ids::Remap::Same,
|
||||
consume_effect_type: super::ids::Remap::Same,
|
||||
enchantment_effect_component_type: super::ids::Remap::Runs {
|
||||
up: ENCHANTMENT_EFFECT_COMPONENT_TYPE_UP,
|
||||
down: ENCHANTMENT_EFFECT_COMPONENT_TYPE_DOWN,
|
||||
},
|
||||
// Not a registry: set by hand where a version numbers EntityDataSerializers differently.
|
||||
entity_data_serializer: super::ids::Remap::Same,
|
||||
};
|
||||
@@ -30,10 +30,12 @@ def ids(report, state, direction):
|
||||
return packets
|
||||
|
||||
|
||||
def table(source, target):
|
||||
"""For each id of `source` (in order), the id `target` gives the same packet, or None."""
|
||||
def table(source, target, renames=None):
|
||||
"""For each id of `source` (in order), the id `target` gives the same packet (or the one it was renamed
|
||||
to), or None."""
|
||||
renames = renames or {}
|
||||
by_id = sorted(source.items(), key=lambda kv: kv[1])
|
||||
return [target.get(name) for name, _ in by_id]
|
||||
return [target.get(renames.get(name, name)) for name, _ in by_id]
|
||||
|
||||
|
||||
def rust_table(name, values):
|
||||
@@ -50,7 +52,12 @@ def main():
|
||||
parser.add_argument("--old", type=Path, required=True, help="the older version's prepared directory")
|
||||
parser.add_argument("--new", type=Path, help="the pinned version's prepared directory (default: .local)")
|
||||
parser.add_argument("--out", type=Path)
|
||||
parser.add_argument("--rename", action="append", default=[], metavar="OLD=NEW",
|
||||
help="a packet the pinned version knows by another name, e.g. "
|
||||
"minecraft:horse_screen_open=minecraft:mount_screen_open")
|
||||
args = parser.parse_args()
|
||||
forward = dict(spec.split("=", 1) for spec in args.rename)
|
||||
backward = {new: old for old, new in forward.items()}
|
||||
old = json.loads((args.old / "datagen/reports/packets.json").read_text())
|
||||
old_info = lab.version_info(args.old / "jars/client.jar")
|
||||
if args.new:
|
||||
@@ -77,7 +84,7 @@ def main():
|
||||
for direction in ["clientbound", "serverbound"]:
|
||||
o, n = ids(old, state, direction), ids(new, state, direction)
|
||||
# Clientbound: indexed by the old server's id. Serverbound: indexed by Horizon's id.
|
||||
values = table(o, n) if direction == "clientbound" else table(n, o)
|
||||
values = table(o, n, forward) if direction == "clientbound" else table(n, o, backward)
|
||||
assert all(v is None or v < 256 for v in values)
|
||||
lines.append("#[rustfmt::skip]")
|
||||
lines.extend(rust_table(f"{state.upper()}_{direction.upper()}", values))
|
||||
|
||||
Reference in new issue
Block a user