feat: add MC 1.21.9/1.21.10 (protocol 773) version constants and enum values

Register protocol 773 for Minecraft 1.21.9 and 1.21.10 (which share the
same protocol as a hotfix release). Update MCHighestVersion to 1.21.10.

Add 49 new item types (copper tools/armor, shelves, copper chests,
copper golem statue variants, oxidized lightning rods, iron chain, etc.),
2 new entity types (CopperGolem, Mannequin), 38 new block materials,
3 new entity metadata serializer types (CopperGolemState,
WeatheringCopperState, ResolvableProfile), and 6 new packet types
(DebugBlockValue, DebugChunkValue, DebugEntityValue, DebugEvent,
GameTestHighlightPos, CodeOfConduct, AcceptCodeOfConduct).

Chain item/block renamed to IronChain in 1.21.9; old enum values
retained for backward compatibility with older palettes.

Made-with: Cursor
This commit is contained in:
BruceChen 2026-03-21 14:04:42 +08:00
parent 5e8d715358
commit 2af0409d00
10 changed files with 153 additions and 13 deletions

View file

@ -26,6 +26,7 @@ namespace MinecraftClient.Inventory
AcaciaPlanks,
AcaciaPressurePlate,
AcaciaSapling,
AcaciaShelf,
AcaciaSign,
AcaciaSlab,
AcaciaStairs,
@ -72,6 +73,7 @@ namespace MinecraftClient.Inventory
BambooPlanks,
BambooPressurePlate,
BambooRaft,
BambooShelf,
BambooSign,
BambooSlab,
BambooStairs,
@ -103,6 +105,7 @@ namespace MinecraftClient.Inventory
BirchPlanks,
BirchPressurePlate,
BirchSapling,
BirchShelf,
BirchSign,
BirchSlab,
BirchStairs,
@ -234,6 +237,7 @@ namespace MinecraftClient.Inventory
CherryPlanks,
CherryPressurePlate,
CherrySapling,
CherryShelf,
CherrySign,
CherrySlab,
CherryStairs,
@ -295,12 +299,27 @@ namespace MinecraftClient.Inventory
CookedRabbit,
CookedSalmon,
Cookie,
CopperAxe,
CopperBlock,
CopperBoots,
CopperBulb,
CopperChest,
CopperChestplate,
CopperDoor,
CopperGolemSpawnEgg,
CopperGolemStatue,
CopperGrate,
CopperHelmet,
CopperHoe,
CopperHorseArmor,
CopperIngot,
CopperLeggings,
CopperNugget,
CopperOre,
CopperPickaxe,
CopperShovel,
CopperSword,
CopperTorch,
CopperTrapdoor,
Cornflower,
CowSpawnEgg,
@ -327,6 +346,7 @@ namespace MinecraftClient.Inventory
CrimsonPlanks,
CrimsonPressurePlate,
CrimsonRoots,
CrimsonShelf,
CrimsonSign,
CrimsonSlab,
CrimsonStairs,
@ -371,6 +391,7 @@ namespace MinecraftClient.Inventory
DarkOakPlanks,
DarkOakPressurePlate,
DarkOakSapling,
DarkOakShelf,
DarkOakSign,
DarkOakSlab,
DarkOakStairs,
@ -481,12 +502,15 @@ namespace MinecraftClient.Inventory
ExposedChiseledCopper,
ExposedCopper,
ExposedCopperBulb,
ExposedCopperChest,
ExposedCopperDoor,
ExposedCopperGolemStatue,
ExposedCopperGrate,
ExposedCopperTrapdoor,
ExposedCutCopper,
ExposedCutCopperSlab,
ExposedCutCopperStairs,
ExposedLightningRod,
EyeArmorTrimSmithingTemplate,
Farmland,
Feather,
@ -627,6 +651,7 @@ namespace MinecraftClient.Inventory
IronBars,
IronBlock,
IronBoots,
IronChain,
IronChestplate,
IronDoor,
IronGolemSpawnEgg,
@ -657,6 +682,7 @@ namespace MinecraftClient.Inventory
JunglePlanks,
JunglePressurePlate,
JungleSapling,
JungleShelf,
JungleSign,
JungleSlab,
JungleStairs,
@ -769,6 +795,7 @@ namespace MinecraftClient.Inventory
MangrovePressurePlate,
MangrovePropagule,
MangroveRoots,
MangroveShelf,
MangroveSign,
MangroveSlab,
MangroveStairs,
@ -868,6 +895,7 @@ namespace MinecraftClient.Inventory
OakPlanks,
OakPressurePlate,
OakSapling,
OakShelf,
OakSign,
OakSlab,
OakStairs,
@ -900,12 +928,15 @@ namespace MinecraftClient.Inventory
OxidizedChiseledCopper,
OxidizedCopper,
OxidizedCopperBulb,
OxidizedCopperChest,
OxidizedCopperDoor,
OxidizedCopperGolemStatue,
OxidizedCopperGrate,
OxidizedCopperTrapdoor,
OxidizedCutCopper,
OxidizedCutCopperSlab,
OxidizedCutCopperStairs,
OxidizedLightningRod,
PackedIce,
PackedMud,
Painting,
@ -924,6 +955,7 @@ namespace MinecraftClient.Inventory
PaleOakPlanks,
PaleOakPressurePlate,
PaleOakSapling,
PaleOakShelf,
PaleOakSign,
PaleOakSlab,
PaleOakStairs,
@ -1197,6 +1229,7 @@ namespace MinecraftClient.Inventory
SprucePlanks,
SprucePressurePlate,
SpruceSapling,
SpruceShelf,
SpruceSign,
SpruceSlab,
SpruceStairs,
@ -1319,6 +1352,7 @@ namespace MinecraftClient.Inventory
WarpedPlanks,
WarpedPressurePlate,
WarpedRoots,
WarpedShelf,
WarpedSign,
WarpedSlab,
WarpedStairs,
@ -1329,7 +1363,9 @@ namespace MinecraftClient.Inventory
WaxedChiseledCopper,
WaxedCopperBlock,
WaxedCopperBulb,
WaxedCopperChest,
WaxedCopperDoor,
WaxedCopperGolemStatue,
WaxedCopperGrate,
WaxedCopperTrapdoor,
WaxedCutCopper,
@ -1338,40 +1374,53 @@ namespace MinecraftClient.Inventory
WaxedExposedChiseledCopper,
WaxedExposedCopper,
WaxedExposedCopperBulb,
WaxedExposedCopperChest,
WaxedExposedCopperDoor,
WaxedExposedCopperGolemStatue,
WaxedExposedCopperGrate,
WaxedExposedCopperTrapdoor,
WaxedExposedCutCopper,
WaxedExposedCutCopperSlab,
WaxedExposedCutCopperStairs,
WaxedExposedLightningRod,
WaxedLightningRod,
WaxedOxidizedChiseledCopper,
WaxedOxidizedCopper,
WaxedOxidizedCopperBulb,
WaxedOxidizedCopperChest,
WaxedOxidizedCopperDoor,
WaxedOxidizedCopperGolemStatue,
WaxedOxidizedCopperGrate,
WaxedOxidizedCopperTrapdoor,
WaxedOxidizedCutCopper,
WaxedOxidizedCutCopperSlab,
WaxedOxidizedCutCopperStairs,
WaxedOxidizedLightningRod,
WaxedWeatheredChiseledCopper,
WaxedWeatheredCopper,
WaxedWeatheredCopperBulb,
WaxedWeatheredCopperChest,
WaxedWeatheredCopperDoor,
WaxedWeatheredCopperGolemStatue,
WaxedWeatheredCopperGrate,
WaxedWeatheredCopperTrapdoor,
WaxedWeatheredCutCopper,
WaxedWeatheredCutCopperSlab,
WaxedWeatheredCutCopperStairs,
WaxedWeatheredLightningRod,
WayfinderArmorTrimSmithingTemplate,
WeatheredChiseledCopper,
WeatheredCopper,
WeatheredCopperBulb,
WeatheredCopperChest,
WeatheredCopperDoor,
WeatheredCopperGolemStatue,
WeatheredCopperGrate,
WeatheredCopperTrapdoor,
WeatheredCutCopper,
WeatheredCutCopperSlab,
WeatheredCutCopperStairs,
WeatheredLightningRod,
WeepingVines,
WetSponge,
Wheat,

View file

@ -98,11 +98,23 @@ public enum EntityMetaDataType
/// </summary>
ArmadilloState,
/// <summary>
/// VarInt (1.21.9+)
/// </summary>
CopperGolemState,
/// <summary>
/// VarInt (1.21.9+)
/// </summary>
WeatheringCopperState,
/// <summary>
/// Float x3
/// </summary>
Vector3,
/// <summary>
/// Float x4
/// </summary>
Quaternion
Quaternion,
/// <summary>
/// Either&lt;GameProfile, Partial&gt; + PlayerSkin.Patch (1.21.9+)
/// </summary>
ResolvableProfile
}

View file

@ -44,6 +44,7 @@ namespace MinecraftClient.Mapping
Chicken,
Cod,
CommandBlockMinecart,
CopperGolem,
Cow,
Creaking,
CreakingTransient,
@ -99,6 +100,7 @@ namespace MinecraftClient.Mapping
MagmaCube,
MangroveBoat,
MangroveChestBoat,
Mannequin,
Marker,
Minecart,
Mooshroom,

View file

@ -24,6 +24,7 @@ namespace MinecraftClient.Mapping
AcaciaPlanks,
AcaciaPressurePlate,
AcaciaSapling,
AcaciaShelf,
AcaciaSign,
AcaciaSlab,
AcaciaStairs,
@ -60,6 +61,7 @@ namespace MinecraftClient.Mapping
BambooPlanks,
BambooPressurePlate,
BambooSapling,
BambooShelf,
BambooSign,
BambooSlab,
BambooStairs,
@ -87,6 +89,7 @@ namespace MinecraftClient.Mapping
BirchPlanks,
BirchPressurePlate,
BirchSapling,
BirchShelf,
BirchSign,
BirchSlab,
BirchStairs,
@ -190,6 +193,7 @@ namespace MinecraftClient.Mapping
CherryPlanks,
CherryPressurePlate,
CherrySapling,
CherryShelf,
CherrySign,
CherrySlab,
CherryStairs,
@ -232,12 +236,19 @@ namespace MinecraftClient.Mapping
Comparator,
Composter,
Conduit,
CopperBars,
CopperBlock,
CopperBulb,
CopperChain,
CopperChest,
CopperDoor,
CopperGolemStatue,
CopperGrate,
CopperLantern,
CopperOre,
CopperTorch,
CopperTrapdoor,
CopperWallTorch,
Cornflower,
CrackedDeepslateBricks,
CrackedDeepslateTiles,
@ -260,6 +271,7 @@ namespace MinecraftClient.Mapping
CrimsonPlanks,
CrimsonPressurePlate,
CrimsonRoots,
CrimsonShelf,
CrimsonSign,
CrimsonSlab,
CrimsonStairs,
@ -301,6 +313,7 @@ namespace MinecraftClient.Mapping
DarkOakPlanks,
DarkOakPressurePlate,
DarkOakSapling,
DarkOakShelf,
DarkOakSign,
DarkOakSlab,
DarkOakStairs,
@ -383,13 +396,19 @@ namespace MinecraftClient.Mapping
EnderChest,
ExposedChiseledCopper,
ExposedCopper,
ExposedCopperBars,
ExposedCopperBulb,
ExposedCopperChain,
ExposedCopperChest,
ExposedCopperDoor,
ExposedCopperGolemStatue,
ExposedCopperGrate,
ExposedCopperLantern,
ExposedCopperTrapdoor,
ExposedCutCopper,
ExposedCutCopperSlab,
ExposedCutCopperStairs,
ExposedLightningRod,
Farmland,
Fern,
Fire,
@ -468,6 +487,7 @@ namespace MinecraftClient.Mapping
InfestedStoneBricks,
IronBars,
IronBlock,
IronChain,
IronDoor,
IronOre,
IronTrapdoor,
@ -484,6 +504,7 @@ namespace MinecraftClient.Mapping
JunglePlanks,
JunglePressurePlate,
JungleSapling,
JungleShelf,
JungleSign,
JungleSlab,
JungleStairs,
@ -580,6 +601,7 @@ namespace MinecraftClient.Mapping
MangrovePressurePlate,
MangrovePropagule,
MangroveRoots,
MangroveShelf,
MangroveSign,
MangroveSlab,
MangroveStairs,
@ -633,6 +655,7 @@ namespace MinecraftClient.Mapping
OakPlanks,
OakPressurePlate,
OakSapling,
OakShelf,
OakSign,
OakSlab,
OakStairs,
@ -662,13 +685,19 @@ namespace MinecraftClient.Mapping
OxeyeDaisy,
OxidizedChiseledCopper,
OxidizedCopper,
OxidizedCopperBars,
OxidizedCopperBulb,
OxidizedCopperChain,
OxidizedCopperChest,
OxidizedCopperDoor,
OxidizedCopperGolemStatue,
OxidizedCopperGrate,
OxidizedCopperLantern,
OxidizedCopperTrapdoor,
OxidizedCutCopper,
OxidizedCutCopperSlab,
OxidizedCutCopperStairs,
OxidizedLightningRod,
PackedIce,
PackedMud,
PaleHangingMoss,
@ -684,6 +713,7 @@ namespace MinecraftClient.Mapping
PaleOakPlanks,
PaleOakPressurePlate,
PaleOakSapling,
PaleOakShelf,
PaleOakSign,
PaleOakSlab,
PaleOakStairs,
@ -930,6 +960,7 @@ namespace MinecraftClient.Mapping
SprucePlanks,
SprucePressurePlate,
SpruceSapling,
SpruceShelf,
SpruceSign,
SpruceSlab,
SpruceStairs,
@ -1025,6 +1056,7 @@ namespace MinecraftClient.Mapping
WarpedPlanks,
WarpedPressurePlate,
WarpedRoots,
WarpedShelf,
WarpedSign,
WarpedSlab,
WarpedStairs,
@ -1036,50 +1068,80 @@ namespace MinecraftClient.Mapping
Water,
WaterCauldron,
WaxedChiseledCopper,
WaxedCopperBars,
WaxedCopperBlock,
WaxedCopperBulb,
WaxedCopperChain,
WaxedCopperChest,
WaxedCopperDoor,
WaxedCopperGolemStatue,
WaxedCopperGrate,
WaxedCopperLantern,
WaxedCopperTrapdoor,
WaxedCutCopper,
WaxedCutCopperSlab,
WaxedCutCopperStairs,
WaxedExposedChiseledCopper,
WaxedExposedCopper,
WaxedExposedCopperBars,
WaxedExposedCopperBulb,
WaxedExposedCopperChain,
WaxedExposedCopperChest,
WaxedExposedCopperDoor,
WaxedExposedCopperGolemStatue,
WaxedExposedCopperGrate,
WaxedExposedCopperLantern,
WaxedExposedCopperTrapdoor,
WaxedExposedCutCopper,
WaxedExposedCutCopperSlab,
WaxedExposedCutCopperStairs,
WaxedExposedLightningRod,
WaxedLightningRod,
WaxedOxidizedChiseledCopper,
WaxedOxidizedCopper,
WaxedOxidizedCopperBars,
WaxedOxidizedCopperBulb,
WaxedOxidizedCopperChain,
WaxedOxidizedCopperChest,
WaxedOxidizedCopperDoor,
WaxedOxidizedCopperGolemStatue,
WaxedOxidizedCopperGrate,
WaxedOxidizedCopperLantern,
WaxedOxidizedCopperTrapdoor,
WaxedOxidizedCutCopper,
WaxedOxidizedCutCopperSlab,
WaxedOxidizedCutCopperStairs,
WaxedOxidizedLightningRod,
WaxedWeatheredChiseledCopper,
WaxedWeatheredCopper,
WaxedWeatheredCopperBars,
WaxedWeatheredCopperBulb,
WaxedWeatheredCopperChain,
WaxedWeatheredCopperChest,
WaxedWeatheredCopperDoor,
WaxedWeatheredCopperGolemStatue,
WaxedWeatheredCopperGrate,
WaxedWeatheredCopperLantern,
WaxedWeatheredCopperTrapdoor,
WaxedWeatheredCutCopper,
WaxedWeatheredCutCopperSlab,
WaxedWeatheredCutCopperStairs,
WaxedWeatheredLightningRod,
WeatheredChiseledCopper,
WeatheredCopper,
WeatheredCopperBars,
WeatheredCopperBulb,
WeatheredCopperChain,
WeatheredCopperChest,
WeatheredCopperDoor,
WeatheredCopperGolemStatue,
WeatheredCopperGrate,
WeatheredCopperLantern,
WeatheredCopperTrapdoor,
WeatheredCutCopper,
WeatheredCutCopperSlab,
WeatheredCutCopperStairs,
WeatheredLightningRod,
WeepingVines,
WeepingVinesPlant,
WetSponge,
@ -1120,4 +1182,4 @@ namespace MinecraftClient.Mapping
ZombieHead,
ZombieWallHead,
}
}
}

View file

@ -46,7 +46,7 @@ namespace MinecraftClient
public const string Version = MCHighestVersion;
public const string MCLowestVersion = "1.4.6";
public const string MCHighestVersion = "1.21.8";
public const string MCHighestVersion = "1.21.10";
public static readonly string? BuildInfo = null;
private static Tuple<Thread, CancellationTokenSource>? offlinePrompt = null;

View file

@ -21,6 +21,7 @@ public enum ConfigurationPacketTypesIn
UpdateTags,
ClearDialog, // Added in 1.21.6
ShowDialog, // Added in 1.21.6
CodeOfConduct, // Added in 1.21.9
Unknown
}

View file

@ -11,6 +11,7 @@ public enum ConfigurationPacketTypesOut
CookieResponse,
KnownDataPacks,
CustomClickAction, // Added in 1.21.6
AcceptCodeOfConduct, // Added in 1.21.9
Unknown
}

View file

@ -164,5 +164,10 @@ namespace MinecraftClient.Protocol.Handlers
Waypoint, // Added in 1.21.6
ClearDialog, // Added in 1.21.6
ShowDialog, // Added in 1.21.6
DebugBlockValue, // Added in 1.21.9
DebugChunkValue, // Added in 1.21.9
DebugEntityValue, // Added in 1.21.9
DebugEvent, // Added in 1.21.9
GameTestHighlightPos, // Added in 1.21.9
}
}

View file

@ -78,6 +78,7 @@ namespace MinecraftClient.Protocol.Handlers
internal const int MC_1_21_5_Version = 770;
internal const int MC_1_21_6_Version = 771;
internal const int MC_1_21_7_Version = 772;
internal const int MC_1_21_9_Version = 773;
private int compression_treshold = -1;
private int autocomplete_transaction_id = 0;
@ -129,21 +130,21 @@ namespace MinecraftClient.Protocol.Handlers
lastSeenMessagesCollector = protocolVersion >= MC_1_19_3_Version ? new(20) : new(5);
chunkBatchStartTime = GetNanos();
if (handler.GetTerrainEnabled() && protocolVersion > MC_1_21_7_Version)
if (handler.GetTerrainEnabled() && protocolVersion > MC_1_21_9_Version)
{
log.Error($"§c{Translations.extra_terrainandmovement_disabled}");
handler.SetTerrainEnabled(false);
}
if (handler.GetInventoryEnabled() &&
protocolVersion is < MC_1_8_Version or > MC_1_21_7_Version)
protocolVersion is < MC_1_8_Version or > MC_1_21_9_Version)
{
log.Error($"§c{Translations.extra_inventory_disabled}");
handler.SetInventoryEnabled(false);
}
if (handler.GetEntityHandlingEnabled() &&
protocolVersion is < MC_1_8_Version or > MC_1_21_7_Version)
protocolVersion is < MC_1_8_Version or > MC_1_21_9_Version)
{
log.Error($"§c{Translations.extra_entity_disabled}");
handler.SetEntityHandlingEnabled(false);
@ -152,9 +153,10 @@ namespace MinecraftClient.Protocol.Handlers
Block.Palette = protocolVersion switch
{
// Block palette
> MC_1_21_7_Version when handler.GetTerrainEnabled() =>
> MC_1_21_9_Version when handler.GetTerrainEnabled() =>
throw new NotImplementedException(Translations.exception_palette_block),
>= MC_1_21_6_Version => new Palette1216(), // 1.21.7 blocks unchanged, reuse 1216
>= MC_1_21_9_Version => new Palette1219(),
>= MC_1_21_6_Version => new Palette1216(), // 1.21.7/1.21.8 blocks unchanged, reuse 1216
>= MC_1_21_5_Version => new Palette1215(),
>= MC_1_21_4_Version => new Palette1214(),
>= MC_1_21_2_Version => new Palette1212(),
@ -175,9 +177,10 @@ namespace MinecraftClient.Protocol.Handlers
entityPalette = protocolVersion switch
{
// Entity palette
> MC_1_21_7_Version when handler.GetEntityHandlingEnabled() =>
> MC_1_21_9_Version when handler.GetEntityHandlingEnabled() =>
throw new NotImplementedException(Translations.exception_palette_entity),
>= MC_1_21_6_Version => new EntityPalette1216(), // 1.21.7 entities unchanged, reuse 1216
>= MC_1_21_9_Version => new EntityPalette1219(),
>= MC_1_21_6_Version => new EntityPalette1216(), // 1.21.7/1.21.8 entities unchanged, reuse 1216
>= MC_1_21_5_Version => new EntityPalette1215(),
>= MC_1_21_4_Version => new EntityPalette1214(),
>= MC_1_21_2_Version => new EntityPalette1212(),
@ -202,8 +205,9 @@ namespace MinecraftClient.Protocol.Handlers
itemPalette = protocolVersion switch
{
// Item palette
> MC_1_21_7_Version when handler.GetInventoryEnabled() =>
> MC_1_21_9_Version when handler.GetInventoryEnabled() =>
throw new NotImplementedException(Translations.exception_palette_item),
>= MC_1_21_9_Version => new ItemPalette1219(),
>= MC_1_21_7_Version => new ItemPalette1217(),
>= MC_1_21_6_Version => new ItemPalette1216(),
>= MC_1_21_5_Version => new ItemPalette1215(),
@ -2661,7 +2665,7 @@ namespace MinecraftClient.Protocol.Handlers
// Also make a palette for field? Will be a lot of work
var healthField = protocolVersion switch
{
> MC_1_21_7_Version => throw new NotImplementedException(Translations
> MC_1_21_9_Version => throw new NotImplementedException(Translations
.exception_palette_healthfield),
// 1.17 and above
>= MC_1_17_Version => 9,

View file

@ -154,7 +154,7 @@ namespace MinecraftClient.Protocol
{
4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404, 477, 480, 485, 490, 498, 573,
575, 578, 735, 736, 751, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768,
769, 770, 771, 772
769, 770, 771, 772, 773
};
if (Array.IndexOf(suppoertedVersionsProtocol18, protocolVersion) > -1)
@ -365,6 +365,9 @@ namespace MinecraftClient.Protocol
case "1.21.7":
case "1.21.8":
return 772;
case "1.21.9":
case "1.21.10":
return 773;
default:
return 0;
}
@ -451,6 +454,7 @@ namespace MinecraftClient.Protocol
770 => "1.21.5",
771 => "1.21.6",
772 => "1.21.7",
773 => "1.21.9",
_ => "0.0"
};
}