mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 02:56:17 -10:00
26.2 stand-ins: a solid block for the shelf mushroom, filled_map for explorer maps
The shelf mushroom is a solid shelf players stand and bounce on (ShelfMushroomBlock's shape); the brown mushroom it stood in as has no collision, so a 26.2 client would fall through what the server stands on and be pulled back. Its block now shows as brown_mushroom_block, whose collision holds the shelf's; the item stays brown_mushroom. The new explorer maps are filled maps (MapItem), so they show as filled_map, which draws their map_id, not as an empty map. v26_2_ids.rs regenerated with --substitutes. TooltipDisplay's writer no longer allocates a list on every write. Review follow-up for #10557 (Detimes). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
1fa86c919f
commit
7e13949bcf
4 files changed
+27
-16
No files matched your search
@@ -416,6 +416,9 @@ mod tests {
|
||||
assert_eq!(update(8), 8);
|
||||
// poplar_log axis=y (167, new in 26.3) shows as birch_log axis=y (146 in 26.3, 143 in 26.2).
|
||||
assert_eq!(update(167), 143);
|
||||
// shelf_mushroom (11227, new in 26.3) is solid: it shows as a brown_mushroom_block (9500 in 26.3, 7766 in
|
||||
// 26.2), not as the brown mushroom players would fall through.
|
||||
assert_eq!(update(11227), 7766);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -436,6 +439,8 @@ mod tests {
|
||||
assert_eq!(slot(1012), 926);
|
||||
// poplar_planks (72, new in 26.3) shows as birch_planks (65 in both).
|
||||
assert_eq!(slot(72), 65);
|
||||
// ocean_monument_map (1239, new in 26.3) is a filled map: filled_map (1238 in 26.3, 1133 in 26.2).
|
||||
assert_eq!(slot(1239), 1133);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -139,8 +139,8 @@ pub const BLOCK_STATE_SUBSTITUTES: &[(u16, u16, u16)] = &[
|
||||
(3465, 19133, 80), (3545, 19133, 80), (3625, 19133, 80), (3705, 15322, 6), (3711, 15322, 6), (3717, 15322, 6), (3723, 15322, 6), (3729, 15322, 6),
|
||||
(3735, 15322, 6), (3741, 15322, 6), (3747, 15322, 6), (3753, 15322, 6), (3759, 15322, 6), (3765, 15322, 6), (3771, 15322, 6), (3777, 15322, 6),
|
||||
(3783, 15322, 6), (3789, 15322, 6), (3795, 15322, 6), (4732, 4220, 64), (7179, 6955, 32), (7487, 7431, 8), (8207, 7631, 64), (8407, 8351, 8),
|
||||
(8547, 8533, 2), (9360, 8912, 64), (11227, 3828, 1), (11228, 3828, 1), (11229, 3828, 1), (11230, 3828, 1), (11231, 3828, 1), (11232, 3828, 1),
|
||||
(11233, 3828, 1), (11234, 3828, 1), (12381, 12375, 1), (12634, 12466, 24), (14139, 11550, 80), (15231, 15189, 6), (15587, 15363, 32), (15907, 15683, 32),
|
||||
(8547, 8533, 2), (9360, 8912, 64), (11227, 9500, 1), (11228, 9500, 1), (11229, 9500, 1), (11230, 9500, 1), (11231, 9500, 1), (11232, 9500, 1),
|
||||
(11233, 9500, 1), (11234, 9500, 1), (12381, 12375, 1), (12634, 12466, 24), (14139, 11550, 80), (15231, 15189, 6), (15587, 15363, 32), (15907, 15683, 32),
|
||||
(16483, 16035, 64), (17027, 19133, 80), (17107, 19133, 80), (17187, 19133, 80), (17267, 19133, 80), (17347, 19133, 80), (17427, 19133, 80), (17507, 19133, 80),
|
||||
(17587, 19133, 80), (17667, 19133, 80), (17747, 19133, 80), (17827, 19133, 80), (17907, 19133, 80), (17987, 19133, 80), (18067, 19133, 80), (18147, 19133, 80),
|
||||
(18227, 19133, 80), (18307, 15322, 6), (18313, 15322, 6), (18319, 15322, 6), (18325, 15322, 6), (18331, 15322, 6), (18337, 15322, 6), (18343, 15322, 6),
|
||||
@@ -156,7 +156,7 @@ pub const BLOCK_SUBSTITUTES: &[(u16, u16, u16)] = &[
|
||||
(180, 893, 1), (181, 893, 1), (182, 893, 1), (183, 678, 1), (184, 678, 1), (185, 678, 1), (186, 678, 1), (187, 678, 1),
|
||||
(188, 678, 1), (189, 678, 1), (190, 678, 1), (191, 678, 1), (192, 678, 1), (193, 678, 1), (194, 678, 1), (195, 678, 1),
|
||||
(196, 678, 1), (197, 678, 1), (198, 678, 1), (233, 225, 1), (263, 256, 1), (278, 271, 1), (291, 282, 1), (302, 295, 1),
|
||||
(318, 311, 1), (374, 367, 1), (447, 215, 1), (472, 466, 1), (504, 497, 1), (574, 456, 1), (662, 655, 1), (690, 683, 1),
|
||||
(318, 311, 1), (374, 367, 1), (447, 388, 1), (472, 466, 1), (504, 497, 1), (574, 456, 1), (662, 655, 1), (690, 683, 1),
|
||||
(700, 693, 1), (710, 703, 1), (784, 893, 1), (785, 893, 1), (786, 893, 1), (787, 893, 1), (788, 893, 1), (789, 893, 1),
|
||||
(790, 893, 1), (791, 893, 1), (792, 893, 1), (793, 893, 1), (794, 893, 1), (795, 893, 1), (796, 893, 1), (797, 893, 1),
|
||||
(798, 893, 1), (799, 893, 1), (800, 678, 1), (801, 678, 1), (802, 678, 1), (803, 678, 1), (804, 678, 1), (805, 678, 1),
|
||||
@@ -177,9 +177,9 @@ pub const ITEM_SUBSTITUTES: &[(u16, u16, u16)] = &[
|
||||
(722, 356, 1), (723, 356, 1), (724, 356, 1), (725, 356, 1), (726, 356, 1), (727, 356, 1), (728, 356, 1), (729, 356, 1),
|
||||
(730, 356, 1), (731, 356, 1), (732, 356, 1), (733, 356, 1), (734, 356, 1), (735, 356, 1), (736, 356, 1), (867, 860, 1),
|
||||
(884, 877, 1), (898, 891, 1), (920, 913, 1), (941, 934, 1), (993, 979, 2), (1111, 1104, 1), (1124, 1117, 1), (1170, 580, 16),
|
||||
(1235, 1223, 1), (1239, 1382, 1), (1240, 1382, 1), (1241, 1382, 1), (1242, 1382, 1), (1243, 1382, 1), (1244, 1382, 1), (1245, 1382, 1),
|
||||
(1246, 1382, 1), (1247, 1382, 1), (1248, 1382, 1), (1249, 1382, 1), (1250, 1382, 1), (1251, 1382, 1), (1252, 1382, 1), (1253, 1382, 1),
|
||||
(1254, 1382, 1),
|
||||
(1235, 1223, 1), (1239, 1238, 1), (1240, 1238, 1), (1241, 1238, 1), (1242, 1238, 1), (1243, 1238, 1), (1244, 1238, 1), (1245, 1238, 1),
|
||||
(1246, 1238, 1), (1247, 1238, 1), (1248, 1238, 1), (1249, 1238, 1), (1250, 1238, 1), (1251, 1238, 1), (1252, 1238, 1), (1253, 1238, 1),
|
||||
(1254, 1238, 1),
|
||||
];
|
||||
/// Stand-ins for pinned `minecraft:entity_type` entries 26.2 lacks, in the pinned numbering.
|
||||
#[rustfmt::skip]
|
||||
|
||||
@@ -654,13 +654,14 @@ impl Component {
|
||||
Self::TooltipDisplay { hide, hidden } => {
|
||||
w.bool(*hide);
|
||||
// Without the components an older client being written for lacks.
|
||||
let hidden: Vec<i32> = hidden
|
||||
.iter()
|
||||
.map(|h| ids::component(*h))
|
||||
.filter(|h| *h >= 0)
|
||||
.collect();
|
||||
w.varint(hidden.len() as i32);
|
||||
hidden.iter().for_each(|h| w.varint(*h));
|
||||
let kept = || {
|
||||
hidden
|
||||
.iter()
|
||||
.map(|h| ids::component(*h))
|
||||
.filter(|h| *h >= 0)
|
||||
};
|
||||
w.varint(kept().count() as i32);
|
||||
kept().for_each(|h| w.varint(h));
|
||||
}
|
||||
Self::Stacks(stacks) => {
|
||||
w.varint(stacks.len() as i32);
|
||||
|
||||
@@ -61,7 +61,9 @@ REGISTRIES = [
|
||||
|
||||
# What stands in for a pinned entry an older client lacks: (registries, pattern, replacement), the pattern matched
|
||||
# against the whole name without its namespace and tried in order; the first replacement the older version has wins.
|
||||
# A block keeps its shape (a slab for a slab), so a client's movement agrees with the server's.
|
||||
# A block keeps its shape (a slab for a slab), so a client's movement agrees with the server's; where no block of the
|
||||
# same shape exists, the stand-in's collision holds the original's (a client walking into what the server calls solid
|
||||
# is pulled back; one stopped short of it is not).
|
||||
BLOCKS = ("minecraft:block", "minecraft:item")
|
||||
SUBSTITUTES = [
|
||||
(BLOCKS, r"\w+_poplar_leaves", "birch_leaves"),
|
||||
@@ -70,9 +72,12 @@ SUBSTITUTES = [
|
||||
(BLOCKS, r"\w+_(wool|concrete)_stairs", "stone_stairs"),
|
||||
(BLOCKS, r"straw_bed", "yellow_bed"),
|
||||
(BLOCKS, r"red_shrub", "dead_bush"),
|
||||
(BLOCKS, r"shelf_mushroom", "brown_mushroom"),
|
||||
# The shelf mushroom is a solid shelf players stand and bounce on; the brown mushroom has no collision.
|
||||
(("minecraft:block",), r"shelf_mushroom", "brown_mushroom_block"),
|
||||
(("minecraft:item",), r"shelf_mushroom", "brown_mushroom"),
|
||||
(("minecraft:item",), r"(\w+)_cushion", r"\1_carpet"),
|
||||
(("minecraft:item",), r"\w+_map", "map"),
|
||||
# The explorer maps are filled maps (MapItem): an empty map would not draw their map_id.
|
||||
(("minecraft:item",), r"\w+_map", "filled_map"),
|
||||
(("minecraft:particle_type",), r"\w+_poplar_leaves", "cherry_leaves"),
|
||||
(("minecraft:sound_event",), r"block\.poplar_leaves\.(\w+)", r"block.cherry_leaves.\1"),
|
||||
(("minecraft:sound_event",), r"entity\.cushion\.(break|place)", r"block.wool.\1"),
|
||||
|
||||
Reference in new issue
Block a user