feat: add MC 1.21.4 (protocol 769) support

Add complete protocol 769 support for Minecraft 1.21.4:

- Version constants: Add 769 to supported versions, MC_1_21_4_Version constant,
  and version string mappings (including 1.21.3 -> 768 compatibility)
- Item palette: 10 new items (Resin series + Eyeblossom), generated ItemPalette1214
- Entity palette: Remove CreakingTransient (149 entities, down from 150)
- Block palette: 10 new blocks with correct blockstate ID ranges from server data
- Packet palette: Serverbound packet ID reshuffling - PickItem split into
  PickItemFromBlock/PickItemFromEntity, new PlayerLoaded packet inserted after
  PlayerInput, subsequent IDs shifted accordingly. Clientbound unchanged.
- PlayerLoaded: Send empty PlayerLoaded packet after JoinGame processing (>= 1.21.4)
- EntityMetadata/DataComponents: Reuse 1.20.6 palettes (unchanged registries)
- Update all version guard checks from MC_1_21_2 to MC_1_21_4

Made-with: Cursor
This commit is contained in:
BruceChen 2026-03-20 23:51:56 +08:00
parent 3acfc0aaa4
commit f73148e5ec
12 changed files with 3699 additions and 11 deletions

File diff suppressed because it is too large Load diff

View file

@ -23,7 +23,7 @@ public abstract class EntityMetadataPalette
<= Protocol18Handler.MC_1_19_2_Version => new EntityMetadataPalette1191(), // 1.13 - 1.19.2
<= Protocol18Handler.MC_1_19_3_Version => new EntityMetadataPalette1193(), // 1.19.3
< Protocol18Handler.MC_1_20_6_Version => new EntityMetadataPalette1194(), // 1.19.4 - 1.20.4
<= Protocol18Handler.MC_1_21_2_Version => new EntityMetadataPalette1206(), // 1.20.6 - 1.21.2
<= Protocol18Handler.MC_1_21_4_Version => new EntityMetadataPalette1206(), // 1.20.6 - 1.21.4
_ => throw new NotImplementedException()
};
}

View file

@ -0,0 +1,168 @@
using System.Collections.Generic;
namespace MinecraftClient.Mapping.EntityPalettes
{
public class EntityPalette1214 : EntityPalette
{
private static readonly Dictionary<int, EntityType> mappings = new();
static EntityPalette1214()
{
mappings[0] = EntityType.AcaciaBoat;
mappings[1] = EntityType.AcaciaChestBoat;
mappings[2] = EntityType.Allay;
mappings[3] = EntityType.AreaEffectCloud;
mappings[4] = EntityType.Armadillo;
mappings[5] = EntityType.ArmorStand;
mappings[6] = EntityType.Arrow;
mappings[7] = EntityType.Axolotl;
mappings[8] = EntityType.BambooChestRaft;
mappings[9] = EntityType.BambooRaft;
mappings[10] = EntityType.Bat;
mappings[11] = EntityType.Bee;
mappings[12] = EntityType.BirchBoat;
mappings[13] = EntityType.BirchChestBoat;
mappings[14] = EntityType.Blaze;
mappings[15] = EntityType.BlockDisplay;
mappings[16] = EntityType.Bogged;
mappings[17] = EntityType.Breeze;
mappings[18] = EntityType.BreezeWindCharge;
mappings[19] = EntityType.Camel;
mappings[20] = EntityType.Cat;
mappings[21] = EntityType.CaveSpider;
mappings[22] = EntityType.CherryBoat;
mappings[23] = EntityType.CherryChestBoat;
mappings[24] = EntityType.ChestMinecart;
mappings[25] = EntityType.Chicken;
mappings[26] = EntityType.Cod;
mappings[27] = EntityType.CommandBlockMinecart;
mappings[28] = EntityType.Cow;
mappings[29] = EntityType.Creaking;
// CreakingTransient removed in 1.21.4
mappings[30] = EntityType.Creeper;
mappings[31] = EntityType.DarkOakBoat;
mappings[32] = EntityType.DarkOakChestBoat;
mappings[33] = EntityType.Dolphin;
mappings[34] = EntityType.Donkey;
mappings[35] = EntityType.DragonFireball;
mappings[36] = EntityType.Drowned;
mappings[37] = EntityType.Egg;
mappings[38] = EntityType.ElderGuardian;
mappings[39] = EntityType.Enderman;
mappings[40] = EntityType.Endermite;
mappings[41] = EntityType.EnderDragon;
mappings[42] = EntityType.EnderPearl;
mappings[43] = EntityType.EndCrystal;
mappings[44] = EntityType.Evoker;
mappings[45] = EntityType.EvokerFangs;
mappings[46] = EntityType.ExperienceBottle;
mappings[47] = EntityType.ExperienceOrb;
mappings[48] = EntityType.EyeOfEnder;
mappings[49] = EntityType.FallingBlock;
mappings[50] = EntityType.Fireball;
mappings[51] = EntityType.FireworkRocket;
mappings[52] = EntityType.Fox;
mappings[53] = EntityType.Frog;
mappings[54] = EntityType.FurnaceMinecart;
mappings[55] = EntityType.Ghast;
mappings[56] = EntityType.Giant;
mappings[57] = EntityType.GlowItemFrame;
mappings[58] = EntityType.GlowSquid;
mappings[59] = EntityType.Goat;
mappings[60] = EntityType.Guardian;
mappings[61] = EntityType.Hoglin;
mappings[62] = EntityType.HopperMinecart;
mappings[63] = EntityType.Horse;
mappings[64] = EntityType.Husk;
mappings[65] = EntityType.Illusioner;
mappings[66] = EntityType.Interaction;
mappings[67] = EntityType.IronGolem;
mappings[68] = EntityType.Item;
mappings[69] = EntityType.ItemDisplay;
mappings[70] = EntityType.ItemFrame;
mappings[71] = EntityType.JungleBoat;
mappings[72] = EntityType.JungleChestBoat;
mappings[73] = EntityType.LeashKnot;
mappings[74] = EntityType.LightningBolt;
mappings[75] = EntityType.Llama;
mappings[76] = EntityType.LlamaSpit;
mappings[77] = EntityType.MagmaCube;
mappings[78] = EntityType.MangroveBoat;
mappings[79] = EntityType.MangroveChestBoat;
mappings[80] = EntityType.Marker;
mappings[81] = EntityType.Minecart;
mappings[82] = EntityType.Mooshroom;
mappings[83] = EntityType.Mule;
mappings[84] = EntityType.OakBoat;
mappings[85] = EntityType.OakChestBoat;
mappings[86] = EntityType.Ocelot;
mappings[87] = EntityType.OminousItemSpawner;
mappings[88] = EntityType.Painting;
mappings[89] = EntityType.PaleOakBoat;
mappings[90] = EntityType.PaleOakChestBoat;
mappings[91] = EntityType.Panda;
mappings[92] = EntityType.Parrot;
mappings[93] = EntityType.Phantom;
mappings[94] = EntityType.Pig;
mappings[95] = EntityType.Piglin;
mappings[96] = EntityType.PiglinBrute;
mappings[97] = EntityType.Pillager;
mappings[98] = EntityType.PolarBear;
mappings[99] = EntityType.Potion;
mappings[100] = EntityType.Pufferfish;
mappings[101] = EntityType.Rabbit;
mappings[102] = EntityType.Ravager;
mappings[103] = EntityType.Salmon;
mappings[104] = EntityType.Sheep;
mappings[105] = EntityType.Shulker;
mappings[106] = EntityType.ShulkerBullet;
mappings[107] = EntityType.Silverfish;
mappings[108] = EntityType.Skeleton;
mappings[109] = EntityType.SkeletonHorse;
mappings[110] = EntityType.Slime;
mappings[111] = EntityType.SmallFireball;
mappings[112] = EntityType.Sniffer;
mappings[113] = EntityType.Snowball;
mappings[114] = EntityType.SnowGolem;
mappings[115] = EntityType.SpawnerMinecart;
mappings[116] = EntityType.SpectralArrow;
mappings[117] = EntityType.Spider;
mappings[118] = EntityType.SpruceBoat;
mappings[119] = EntityType.SpruceChestBoat;
mappings[120] = EntityType.Squid;
mappings[121] = EntityType.Stray;
mappings[122] = EntityType.Strider;
mappings[123] = EntityType.Tadpole;
mappings[124] = EntityType.TextDisplay;
mappings[125] = EntityType.Tnt;
mappings[126] = EntityType.TntMinecart;
mappings[127] = EntityType.TraderLlama;
mappings[128] = EntityType.Trident;
mappings[129] = EntityType.TropicalFish;
mappings[130] = EntityType.Turtle;
mappings[131] = EntityType.Vex;
mappings[132] = EntityType.Villager;
mappings[133] = EntityType.Vindicator;
mappings[134] = EntityType.WanderingTrader;
mappings[135] = EntityType.Warden;
mappings[136] = EntityType.WindCharge;
mappings[137] = EntityType.Witch;
mappings[138] = EntityType.Wither;
mappings[139] = EntityType.WitherSkeleton;
mappings[140] = EntityType.WitherSkull;
mappings[141] = EntityType.Wolf;
mappings[142] = EntityType.Zoglin;
mappings[143] = EntityType.Zombie;
mappings[144] = EntityType.ZombieHorse;
mappings[145] = EntityType.ZombieVillager;
mappings[146] = EntityType.ZombifiedPiglin;
mappings[147] = EntityType.Player;
mappings[148] = EntityType.FishingBobber;
}
protected override Dictionary<int, EntityType> GetDict()
{
return mappings;
}
}
}

View file

@ -204,6 +204,7 @@ namespace MinecraftClient.Mapping
ChiseledPolishedBlackstone,
ChiseledQuartzBlock,
ChiseledRedSandstone,
ChiseledResinBricks,
ChiseledSandstone,
ChiseledStoneBricks,
ChiseledTuff,
@ -211,6 +212,7 @@ namespace MinecraftClient.Mapping
ChorusFlower,
ChorusPlant,
Clay,
ClosedEyeblossom,
CoalBlock,
CoalOre,
CoarseDirt,
@ -636,6 +638,7 @@ namespace MinecraftClient.Mapping
Observer,
Obsidian,
OchreFroglight,
OpenEyeblossom,
OrangeBanner,
OrangeBed,
OrangeCandle,
@ -752,6 +755,7 @@ namespace MinecraftClient.Mapping
PottedBrownMushroom,
PottedCactus,
PottedCherrySapling,
PottedClosedEyeblossom,
PottedCornflower,
PottedCrimsonFungus,
PottedCrimsonRoots,
@ -764,6 +768,7 @@ namespace MinecraftClient.Mapping
PottedLilyOfTheValley,
PottedMangrovePropagule,
PottedOakSapling,
PottedOpenEyeblossom,
PottedOrangeTulip,
PottedOxeyeDaisy,
PottedPaleOakSapling,
@ -851,6 +856,12 @@ namespace MinecraftClient.Mapping
ReinforcedDeepslate,
Repeater,
RepeatingCommandBlock,
ResinBlock,
ResinBrickSlab,
ResinBrickStairs,
ResinBrickWall,
ResinBricks,
ResinClump,
RespawnAnchor,
RootedDirt,
RoseBush,

View file

@ -1,4 +1,4 @@
namespace MinecraftClient.Mapping
namespace MinecraftClient.Mapping
{
/// <summary>
/// Defines extension methods for the Material enumeration
@ -122,6 +122,7 @@
case Material.ChiseledPolishedBlackstone:
case Material.ChiseledQuartzBlock:
case Material.ChiseledRedSandstone:
case Material.ChiseledResinBricks:
case Material.ChiseledSandstone:
case Material.ChiseledStoneBricks:
case Material.ChorusFlower:
@ -500,6 +501,8 @@
case Material.PottedBlueOrchid:
case Material.PottedBrownMushroom:
case Material.PottedCactus:
case Material.PottedCherrySapling:
case Material.PottedClosedEyeblossom:
case Material.PottedCornflower:
case Material.PottedDandelion:
case Material.PottedDarkOakSapling:
@ -509,6 +512,7 @@
case Material.PottedJungleSapling:
case Material.PottedLilyOfTheValley:
case Material.PottedOakSapling:
case Material.PottedOpenEyeblossom:
case Material.PottedOrangeTulip:
case Material.PottedOxeyeDaisy:
case Material.PottedPinkTulip:
@ -576,6 +580,10 @@
case Material.RedWool:
case Material.ReinforcedDeepslate:
case Material.RepeatingCommandBlock:
case Material.ResinBlock:
case Material.ResinBrickStairs:
case Material.ResinBrickWall:
case Material.ResinBricks:
case Material.RespawnAnchor:
case Material.RootedDirt:
case Material.Sand:
@ -868,6 +876,7 @@
case Material.QuartzSlab:
case Material.RedNetherBrickSlab:
case Material.RedSandstoneSlab:
case Material.ResinBrickSlab:
case Material.SandstoneSlab:
case Material.SmoothQuartzSlab:
case Material.SmoothRedSandstoneSlab: