feat: Added Minecraft 26.2 support

Add Minecraft 26.2 support (protocol 776)
This commit is contained in:
Anon 2026-07-04 21:58:48 +02:00 committed by GitHub
commit 142fb107db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 4569 additions and 21 deletions

View file

@ -56,10 +56,11 @@ Feature columns mean:
| 1.21.5-1.21.8 | `Protocol18Handler` | Yes | Yes | Yes | 1.21.7/1.21.8 reuse 1.21.6 block/entity palettes in code |
| 1.21.9-1.21.10 | `Protocol18Handler` | Yes | Yes | Yes | Version tools prefer server data reports since 1.21.9 |
| 1.21.11 | `Protocol18Handler` | Yes | Yes | Yes | Own entity/item/metadata palettes; blocks reuse 1.21.9 palette |
| 26.1 | `Protocol18Handler` | Yes | Yes | Yes | Latest coded support; new Minecraft version naming scheme |
| 26.1 | `Protocol18Handler` | Yes | Yes | Yes | New Minecraft version naming scheme |
| 26.2 | `Protocol18Handler` | Yes | Yes | Yes | Latest coded support; own item/block/entity palettes, reuses 26.1 packet IDs and metadata serializers |
Notes:
- Declared code range is `1.4.6` to `26.1`.
- Declared code range is `1.4.6` to `26.2`.
- Human docs are stale in places and sometimes stop at older ranges; prefer code when docs and code disagree.
- Movement/pathing limits called out in docs still apply: no swimming, no knockback. The `Physics/` engine adds vanilla-accurate collision and movement but some edge cases remain.

File diff suppressed because it is too large Load diff

View file

@ -250,6 +250,7 @@ namespace MinecraftClient.Inventory
ChickenSpawnEgg,
ChippedAnvil,
ChiseledBookshelf,
ChiseledCinnabar,
ChiseledCopper,
ChiseledDeepslate,
ChiseledNetherBricks,
@ -259,11 +260,20 @@ namespace MinecraftClient.Inventory
ChiseledResinBricks,
ChiseledSandstone,
ChiseledStoneBricks,
ChiseledSulfur,
ChiseledTuff,
ChiseledTuffBricks,
ChorusFlower,
ChorusFruit,
ChorusPlant,
Cinnabar,
CinnabarBrickSlab,
CinnabarBrickStairs,
CinnabarBrickWall,
CinnabarBricks,
CinnabarSlab,
CinnabarStairs,
CinnabarWall,
Clay,
ClayBall,
Clock,
@ -851,6 +861,7 @@ namespace MinecraftClient.Inventory
MusicDisc13,
MusicDisc5,
MusicDiscBlocks,
MusicDiscBounce,
MusicDiscCat,
MusicDiscChirp,
MusicDiscCreator,
@ -1039,6 +1050,10 @@ namespace MinecraftClient.Inventory
PolishedBlackstoneSlab,
PolishedBlackstoneStairs,
PolishedBlackstoneWall,
PolishedCinnabar,
PolishedCinnabarSlab,
PolishedCinnabarStairs,
PolishedCinnabarWall,
PolishedDeepslate,
PolishedDeepslateSlab,
PolishedDeepslateStairs,
@ -1049,6 +1064,10 @@ namespace MinecraftClient.Inventory
PolishedGranite,
PolishedGraniteSlab,
PolishedGraniteStairs,
PolishedSulfur,
PolishedSulfurSlab,
PolishedSulfurStairs,
PolishedSulfurWall,
PolishedTuff,
PolishedTuffSlab,
PolishedTuffStairs,
@ -1057,6 +1076,7 @@ namespace MinecraftClient.Inventory
Poppy,
Porkchop,
Potato,
PotentSulfur,
Potion,
PowderSnowBucket,
PoweredRail,
@ -1310,6 +1330,17 @@ namespace MinecraftClient.Inventory
StructureVoid,
Sugar,
SugarCane,
Sulfur,
SulfurBrickSlab,
SulfurBrickStairs,
SulfurBrickWall,
SulfurBricks,
SulfurCubeBucket,
SulfurCubeSpawnEgg,
SulfurSlab,
SulfurSpike,
SulfurStairs,
SulfurWall,
Sunflower,
SuspiciousGravel,
SuspiciousSand,

File diff suppressed because it is too large Load diff

View file

@ -27,7 +27,7 @@ public abstract class EntityMetadataPalette
<= Protocol18Handler.MC_1_21_7_Version => new EntityMetadataPalette1215(), // 1.21.5 - 1.21.8
<= Protocol18Handler.MC_1_21_9_Version => new EntityMetadataPalette1219(), // 1.21.9 - 1.21.10
<= Protocol18Handler.MC_1_21_11_Version => new EntityMetadataPalette12111(), // 1.21.11
<= Protocol18Handler.MC_26_1_Version => new EntityMetadataPalette261(), // 26.1
<= Protocol18Handler.MC_26_2_Version => new EntityMetadataPalette261(), // 26.1 - 26.2 (serializers unchanged in 26.2)
_ => throw new NotImplementedException()
};
}

View file

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

View file

@ -150,6 +150,7 @@ namespace MinecraftClient.Mapping
Squid,
Stray,
Strider,
SulfurCube,
Tadpole,
TextDisplay,
Tnt,

View file

@ -204,6 +204,7 @@ namespace MinecraftClient.Mapping
Chest,
ChippedAnvil,
ChiseledBookshelf,
ChiseledCinnabar,
ChiseledCopper,
ChiseledDeepslate,
ChiseledNetherBricks,
@ -213,10 +214,19 @@ namespace MinecraftClient.Mapping
ChiseledResinBricks,
ChiseledSandstone,
ChiseledStoneBricks,
ChiseledSulfur,
ChiseledTuff,
ChiseledTuffBricks,
ChorusFlower,
ChorusPlant,
Cinnabar,
CinnabarBrickSlab,
CinnabarBrickStairs,
CinnabarBrickWall,
CinnabarBricks,
CinnabarSlab,
CinnabarStairs,
CinnabarWall,
Clay,
ClosedEyeblossom,
CoalBlock,
@ -765,6 +775,10 @@ namespace MinecraftClient.Mapping
PolishedBlackstoneSlab,
PolishedBlackstoneStairs,
PolishedBlackstoneWall,
PolishedCinnabar,
PolishedCinnabarSlab,
PolishedCinnabarStairs,
PolishedCinnabarWall,
PolishedDeepslate,
PolishedDeepslateSlab,
PolishedDeepslateStairs,
@ -775,12 +789,17 @@ namespace MinecraftClient.Mapping
PolishedGranite,
PolishedGraniteSlab,
PolishedGraniteStairs,
PolishedSulfur,
PolishedSulfurSlab,
PolishedSulfurStairs,
PolishedSulfurWall,
PolishedTuff,
PolishedTuffSlab,
PolishedTuffStairs,
PolishedTuffWall,
Poppy,
Potatoes,
PotentSulfur,
PottedAcaciaSapling,
PottedAllium,
PottedAzaleaBush,
@ -1007,6 +1026,15 @@ namespace MinecraftClient.Mapping
StructureBlock,
StructureVoid,
SugarCane,
Sulfur,
SulfurBrickSlab,
SulfurBrickStairs,
SulfurBrickWall,
SulfurBricks,
SulfurSlab,
SulfurSpike,
SulfurStairs,
SulfurWall,
Sunflower,
SuspiciousGravel,
SuspiciousSand,

File diff suppressed because one or more lines are too long

View file

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

View file

@ -48,9 +48,9 @@ namespace MinecraftClient.Protocol.Handlers
{
PacketTypePalette p = protocol switch
{
> Protocol18Handler.MC_26_1_Version => throw new NotImplementedException(Translations
> Protocol18Handler.MC_26_2_Version => throw new NotImplementedException(Translations
.exception_palette_packet),
>= Protocol18Handler.MC_26_1_Version => new PacketPalette261(),
>= Protocol18Handler.MC_26_1_Version => new PacketPalette261(), // 26.1 - 26.2 (packet IDs unchanged in 26.2)
<= Protocol18Handler.MC_1_21_11_Version and > Protocol18Handler.MC_1_21_7_Version => new PacketPalette1219(),
<= Protocol18Handler.MC_1_21_7_Version and > Protocol18Handler.MC_1_21_5_Version => new PacketPalette1216(),
<= Protocol18Handler.MC_1_21_5_Version and > Protocol18Handler.MC_1_21_4_Version => new PacketPalette1215(),

View file

@ -84,6 +84,7 @@ namespace MinecraftClient.Protocol.Handlers
internal const int MC_1_21_9_Version = 773;
internal const int MC_1_21_11_Version = 774;
internal const int MC_26_1_Version = 775;
internal const int MC_26_2_Version = 776;
private int compression_treshold = -1;
private int autocomplete_transaction_id = 0;
@ -145,21 +146,21 @@ namespace MinecraftClient.Protocol.Handlers
lastSeenMessagesCollector = protocolVersion >= MC_1_19_3_Version ? new(20) : new(5);
chunkBatchStartTime = GetNanos();
if (handler.GetTerrainEnabled() && protocolVersion > MC_26_1_Version)
if (handler.GetTerrainEnabled() && protocolVersion > MC_26_2_Version)
{
log.Error($"§c{Translations.extra_terrainandmovement_disabled}");
handler.SetTerrainEnabled(false);
}
if (handler.GetInventoryEnabled() &&
protocolVersion is < MC_1_8_Version or > MC_26_1_Version)
protocolVersion is < MC_1_8_Version or > MC_26_2_Version)
{
log.Error($"§c{Translations.extra_inventory_disabled}");
handler.SetInventoryEnabled(false);
}
if (handler.GetEntityHandlingEnabled() &&
protocolVersion is < MC_1_8_Version or > MC_26_1_Version)
protocolVersion is < MC_1_8_Version or > MC_26_2_Version)
{
log.Error($"§c{Translations.extra_entity_disabled}");
handler.SetEntityHandlingEnabled(false);
@ -168,8 +169,9 @@ namespace MinecraftClient.Protocol.Handlers
Block.Palette = protocolVersion switch
{
// Block palette
> MC_26_1_Version when handler.GetTerrainEnabled() =>
> MC_26_2_Version when handler.GetTerrainEnabled() =>
throw new NotImplementedException(Translations.exception_palette_block),
>= MC_26_2_Version => new Palette262(),
>= MC_26_1_Version => new Palette261(),
>= MC_1_21_9_Version => new Palette1219(),
>= MC_1_21_6_Version => new Palette1216(), // 1.21.7/1.21.8 blocks unchanged, reuse 1216
@ -193,8 +195,9 @@ namespace MinecraftClient.Protocol.Handlers
entityPalette = protocolVersion switch
{
// Entity palette
> MC_26_1_Version when handler.GetEntityHandlingEnabled() =>
> MC_26_2_Version when handler.GetEntityHandlingEnabled() =>
throw new NotImplementedException(Translations.exception_palette_entity),
>= MC_26_2_Version => new EntityPalette262(),
>= MC_26_1_Version => new EntityPalette261(),
>= MC_1_21_11_Version => new EntityPalette12111(),
>= MC_1_21_9_Version => new EntityPalette1219(),
@ -224,8 +227,9 @@ namespace MinecraftClient.Protocol.Handlers
itemPalette = protocolVersion switch
{
// Item palette
> MC_26_1_Version when handler.GetInventoryEnabled() =>
> MC_26_2_Version when handler.GetInventoryEnabled() =>
throw new NotImplementedException(Translations.exception_palette_item),
>= MC_26_2_Version => new ItemPalette262(),
>= MC_26_1_Version => new ItemPalette261(),
>= MC_1_21_11_Version => new ItemPalette12111(),
>= MC_1_21_9_Version => new ItemPalette1219(),
@ -2823,7 +2827,7 @@ namespace MinecraftClient.Protocol.Handlers
// Also make a palette for field? Will be a lot of work
var healthField = protocolVersion switch
{
> MC_26_1_Version => throw new NotImplementedException(Translations
> MC_26_2_Version => throw new NotImplementedException(Translations
.exception_palette_healthfield),
// 1.17 and above
>= MC_1_17_Version => 9,
@ -3196,10 +3200,15 @@ namespace MinecraftClient.Protocol.Handlers
// displayName (component), options (byte),
// nameTagVisibility, collisionRule, color (VarInt),
// prefix (component), suffix (component)
// 1.21.5+ method 0/2:
// 1.21.5-26.1 method 0/2:
// displayName (component), options (byte),
// nameTagVisibility (VarInt), collisionRule (VarInt),
// color (VarInt), prefix (component), suffix (component)
// 26.2+ method 0/2:
// displayName (component), prefix (component),
// suffix (component), nameTagVisibility (VarInt),
// collisionRule (VarInt), color (Optional<VarInt>),
// options (byte)
// method 0/3/4: players list (VarInt count + strings)
var teamName = dataTypes.ReadNextString(packetData);
var teamMethod = dataTypes.ReadNextByte(packetData);
@ -3227,6 +3236,39 @@ namespace MinecraftClient.Protocol.Handlers
teamColor = unchecked((sbyte)dataTypes.ReadNextByte(packetData));
}
else if (protocolVersion >= MC_26_2_Version)
{
teamDisplayName = dataTypes.ReadNextChat(packetData);
teamPrefix = dataTypes.ReadNextChat(packetData);
teamSuffix = dataTypes.ReadNextChat(packetData);
// STREAM_CODEC: 0=always, 1=never, 2=hideForOtherTeams, 3=hideForOwnTeam
teamNameTagVisibility = dataTypes.ReadNextVarInt(packetData) switch
{
0 => "always",
1 => "never",
2 => "hideForOtherTeams",
3 => "hideForOwnTeam",
_ => "always"
};
// STREAM_CODEC: 0=always, 1=never, 2=pushOtherTeams, 3=pushOwnTeam
teamCollisionRule = dataTypes.ReadNextVarInt(packetData) switch
{
0 => "always",
1 => "never",
2 => "pushOtherTeams",
3 => "pushOwnTeam",
_ => "always"
};
// Optional<TeamColor>: bool + VarInt id (ids match legacy color ordinals 0-15)
teamColor = dataTypes.ReadNextBool(packetData)
? dataTypes.ReadNextVarInt(packetData)
: -1;
teamFriendlyFlags = dataTypes.ReadNextByte(packetData);
}
else
{
teamDisplayName = dataTypes.ReadNextChat(packetData);

View file

@ -0,0 +1,25 @@
using System.Collections.Generic;
using MinecraftClient.Inventory;
using MinecraftClient.Inventory.ItemPalettes;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Core;
namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._26_2;
public class SulfurCubeContentComponent262(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
{
public Item? AbsorbedBlockItemStack { get; set; }
public override void Parse(Queue<byte> data)
{
AbsorbedBlockItemStack = DataTypes.ReadNextItemStackTemplate(data, ItemPalette);
}
public override Queue<byte> Serialize()
{
var data = new List<byte>();
if (AbsorbedBlockItemStack is not null && !AbsorbedBlockItemStack.IsEmpty)
data.AddRange(DataTypes.GetItemStackTemplate(AbsorbedBlockItemStack, ItemPalette));
return new Queue<byte>(data);
}
}

View file

@ -0,0 +1,134 @@
using MinecraftClient.Inventory.ItemPalettes;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_20_6;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_2;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_5;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_8;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_9;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._26_1;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._26_2;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Core;
namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Registries;
public class StructuredComponentsRegistry262 : StructuredComponentRegistry
{
public StructuredComponentsRegistry262(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
: base(dataTypes, itemPalette, subComponentRegistry)
{
RegisterComponent<CustomDataComponent>(0, "minecraft:custom_data");
RegisterComponent<MaxStackSizeComponent>(1, "minecraft:max_stack_size");
RegisterComponent<MaxDamageComponent>(2, "minecraft:max_damage");
RegisterComponent<DamageComponent>(3, "minecraft:damage");
RegisterComponent<EmptyComponent>(4, "minecraft:unbreakable");
RegisterComponent<UseEffectsComponent>(5, "minecraft:use_effects");
RegisterComponent<CustomNameComponent>(6, "minecraft:custom_name");
RegisterComponent<PotionDurationScaleComponent>(7, "minecraft:minimum_attack_charge");
RegisterComponent<VarIntComponent>(8, "minecraft:damage_type");
RegisterComponent<ItemNameComponent>(9, "minecraft:item_name");
RegisterComponent<ItemModelComponent>(10, "minecraft:item_model");
RegisterComponent<LoreNameComponent1206>(11, "minecraft:lore");
RegisterComponent<RarityComponent>(12, "minecraft:rarity");
RegisterComponent<EnchantmentsComponent1215>(13, "minecraft:enchantments");
RegisterComponent<CanPlaceOnComponent1215>(14, "minecraft:can_place_on");
RegisterComponent<CanBreakComponent1215>(15, "minecraft:can_break");
RegisterComponent<AttributeModifiersComponent1218>(16, "minecraft:attribute_modifiers");
RegisterComponent<CustomModelDataComponent>(17, "minecraft:custom_model_data");
RegisterComponent<TooltipDisplayComponent>(18, "minecraft:tooltip_display");
RegisterComponent<RepairCostComponent>(19, "minecraft:repair_cost");
RegisterComponent<CreativeSlotLockComponent>(20, "minecraft:creative_slot_lock");
RegisterComponent<EnchantmentGlintOverrideComponent>(21, "minecraft:enchantment_glint_override");
RegisterComponent<IntangibleProjectileComponent>(22, "minecraft:intangible_projectile");
RegisterComponent<FoodComponent1212>(23, "minecraft:food");
RegisterComponent<ConsumableComponent>(24, "minecraft:consumable");
RegisterComponent<UseRemainderComponent261>(25, "minecraft:use_remainder");
RegisterComponent<UseCooldownComponent>(26, "minecraft:use_cooldown");
RegisterComponent<HolderSetComponent261>(27, "minecraft:damage_resistant");
RegisterComponent<ToolComponent1215>(28, "minecraft:tool");
RegisterComponent<WeaponComponent>(29, "minecraft:weapon");
RegisterComponent<AttackRangeComponent>(30, "minecraft:attack_range");
RegisterComponent<EnchantableComponent>(31, "minecraft:enchantable");
RegisterComponent<EquippableComponent1218>(32, "minecraft:equippable");
RegisterComponent<RepairableComponent>(33, "minecraft:repairable");
RegisterComponent<GliderComponent>(34, "minecraft:glider");
RegisterComponent<TooltipStyleComponent>(35, "minecraft:tooltip_style");
RegisterComponent<DeathProtectionComponent>(36, "minecraft:death_protection");
RegisterComponent<BlocksAttacksComponent>(37, "minecraft:blocks_attacks");
RegisterComponent<PiercingWeaponComponent>(38, "minecraft:piercing_weapon");
RegisterComponent<KineticWeaponComponent>(39, "minecraft:kinetic_weapon");
RegisterComponent<SwingAnimationComponent>(40, "minecraft:swing_animation");
RegisterComponent<VarIntComponent>(41, "minecraft:additional_trade_cost"); // New in 26.1
RegisterComponent<StoredEnchantmentsComponent1215>(42, "minecraft:stored_enchantments");
RegisterComponent<VarIntComponent>(43, "minecraft:dye"); // New in 26.1
RegisterComponent<DyeColorComponent1215>(44, "minecraft:dyed_color");
RegisterComponent<MapColorComponent>(45, "minecraft:map_color");
RegisterComponent<MapIdComponent>(46, "minecraft:map_id");
RegisterComponent<MapDecorationsComponent>(47, "minecraft:map_decorations");
RegisterComponent<MapPostProcessingComponent>(48, "minecraft:map_post_processing");
RegisterComponent<ItemStackTemplateListComponent261>(49, "minecraft:charged_projectiles");
RegisterComponent<ItemStackTemplateListComponent261>(50, "minecraft:bundle_contents");
RegisterComponent<PotionContentsComponent1212>(51, "minecraft:potion_contents");
RegisterComponent<PotionDurationScaleComponent>(52, "minecraft:potion_duration_scale");
RegisterComponent<SuspiciousStewEffectsComponent>(53, "minecraft:suspicious_stew_effects");
RegisterComponent<WritableBookContentComponent>(54, "minecraft:writable_book_content");
RegisterComponent<WrittenBookContentComponent>(55, "minecraft:written_book_content");
RegisterComponent<TrimComponent1215>(56, "minecraft:trim");
RegisterComponent<DebugStickStateComponent>(57, "minecraft:debug_stick_state");
RegisterComponent<TypedEntityDataComponent>(58, "minecraft:entity_data");
RegisterComponent<BucketEntityDataComponent>(59, "minecraft:bucket_entity_data");
RegisterComponent<TypedBlockEntityDataComponent>(60, "minecraft:block_entity_data");
RegisterComponent<InstrumentComponent261>(61, "minecraft:instrument");
RegisterComponent<ProvidesTrimMaterialComponent261>(62, "minecraft:provides_trim_material");
RegisterComponent<OminousBottleAmplifierComponent>(63, "minecraft:ominous_bottle_amplifier");
RegisterComponent<JukeBoxPlayableComponent1215>(64, "minecraft:jukebox_playable");
RegisterComponent<HolderSetComponent261>(65, "minecraft:provides_banner_patterns");
RegisterComponent<NbtTagComponent261>(66, "minecraft:recipes");
RegisterComponent<LodestoneTrackerComponent>(67, "minecraft:lodestone_tracker");
RegisterComponent<FireworkExplosionComponent>(68, "minecraft:firework_explosion");
RegisterComponent<FireworksComponent>(69, "minecraft:fireworks");
RegisterComponent<ProfileComponent>(70, "minecraft:profile");
RegisterComponent<NoteBlockSoundComponent>(71, "minecraft:note_block_sound");
RegisterComponent<BannerPatternsComponent>(72, "minecraft:banner_patterns");
RegisterComponent<BaseColorComponent>(73, "minecraft:base_color");
RegisterComponent<PotDecorationsComponent>(74, "minecraft:pot_decorations");
RegisterComponent<ContainerComponent261>(75, "minecraft:container");
RegisterComponent<BlockStateComponent>(76, "minecraft:block_state");
RegisterComponent<BeesComponent1219>(77, "minecraft:bees");
RegisterComponent<SulfurCubeContentComponent262>(78, "minecraft:sulfur_cube_content"); // New in 26.2
RegisterComponent<LockComponent>(79, "minecraft:lock");
RegisterComponent<ContainerLootComponent>(80, "minecraft:container_loot");
RegisterComponent<SoundEventHolderComponent>(81, "minecraft:break_sound");
RegisterComponent<VarIntComponent>(82, "minecraft:villager/variant");
RegisterComponent<VarIntComponent>(83, "minecraft:wolf/variant");
RegisterComponent<VarIntComponent>(84, "minecraft:wolf/sound_variant");
RegisterComponent<VarIntComponent>(85, "minecraft:wolf/collar");
RegisterComponent<VarIntComponent>(86, "minecraft:fox/variant");
RegisterComponent<VarIntComponent>(87, "minecraft:salmon/size");
RegisterComponent<VarIntComponent>(88, "minecraft:parrot/variant");
RegisterComponent<VarIntComponent>(89, "minecraft:tropical_fish/pattern");
RegisterComponent<VarIntComponent>(90, "minecraft:tropical_fish/base_color");
RegisterComponent<VarIntComponent>(91, "minecraft:tropical_fish/pattern_color");
RegisterComponent<VarIntComponent>(92, "minecraft:mooshroom/variant");
RegisterComponent<VarIntComponent>(93, "minecraft:rabbit/variant");
RegisterComponent<VarIntComponent>(94, "minecraft:pig/variant");
RegisterComponent<VarIntComponent>(95, "minecraft:pig/sound_variant"); // New in 26.1
RegisterComponent<VarIntComponent>(96, "minecraft:cow/variant");
RegisterComponent<VarIntComponent>(97, "minecraft:cow/sound_variant"); // New in 26.1
RegisterComponent<VarIntComponent>(98, "minecraft:chicken/variant");
RegisterComponent<VarIntComponent>(99, "minecraft:chicken/sound_variant"); // New in 26.1
RegisterComponent<VarIntComponent>(100, "minecraft:zombie_nautilus/variant");
RegisterComponent<VarIntComponent>(101, "minecraft:frog/variant");
RegisterComponent<VarIntComponent>(102, "minecraft:horse/variant");
RegisterComponent<PaintingVariantHolderComponent>(103, "minecraft:painting/variant");
RegisterComponent<VarIntComponent>(104, "minecraft:llama/variant");
RegisterComponent<VarIntComponent>(105, "minecraft:axolotl/variant");
RegisterComponent<VarIntComponent>(106, "minecraft:cat/variant");
RegisterComponent<VarIntComponent>(107, "minecraft:cat/sound_variant"); // New in 26.1
RegisterComponent<VarIntComponent>(108, "minecraft:cat/collar");
RegisterComponent<VarIntComponent>(109, "minecraft:sheep/color");
RegisterComponent<VarIntComponent>(110, "minecraft:shulker/color");
}
}

View file

@ -33,6 +33,7 @@ public class StructuredComponentsHandler
{
Protocol18Handler.MC_1_20_6_Version => typeof(StructuredComponentsRegistry1206),
Protocol18Handler.MC_1_21_Version => typeof(StructuredComponentsRegistry121),
>= Protocol18Handler.MC_26_2_Version => typeof(StructuredComponentsRegistry262),
>= Protocol18Handler.MC_26_1_Version => typeof(StructuredComponentsRegistry261),
>= Protocol18Handler.MC_1_21_11_Version => typeof(StructuredComponentsRegistry12111),
>= Protocol18Handler.MC_1_21_5_Version => typeof(StructuredComponentsRegistry1215),

View file

@ -156,7 +156,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, 773, 774, 775
769, 770, 771, 772, 773, 774, 775, 776
};
if (Array.IndexOf(suppoertedVersionsProtocol18, normalizedVersion) > -1)
@ -374,6 +374,8 @@ namespace MinecraftClient.Protocol
return 774;
case "26.1":
return 775;
case "26.2":
return 776;
default:
return 0;
}
@ -396,7 +398,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, 773, 774, 775
772, 773, 774, 775, 776
];
/// <summary>
@ -518,6 +520,7 @@ namespace MinecraftClient.Protocol
773 => "1.21.9",
774 => "1.21.11",
775 => "26.1",
776 => "26.2",
_ => "0.0"
};
}

View file

@ -1,5 +1,5 @@
{
"version": "26.1-rc-2",
"version": "26.2",
"colors": {
"AcaciaDoor": [
216,
@ -696,6 +696,11 @@
119,
72
],
"ChiseledCinnabar": [
153,
51,
51
],
"ChiseledNetherBricks": [
112,
2,
@ -726,6 +731,11 @@
112,
112
],
"ChiseledSulfur": [
229,
229,
51
],
"ChorusFlower": [
127,
63,
@ -736,6 +746,46 @@
63,
178
],
"Cinnabar": [
153,
51,
51
],
"CinnabarBrickSlab": [
153,
51,
51
],
"CinnabarBrickStairs": [
153,
51,
51
],
"CinnabarBrickWall": [
153,
51,
51
],
"CinnabarBricks": [
153,
51,
51
],
"CinnabarSlab": [
153,
51,
51
],
"CinnabarStairs": [
153,
51,
51
],
"CinnabarWall": [
153,
51,
51
],
"Clay": [
164,
168,
@ -2526,6 +2576,26 @@
25,
25
],
"PolishedCinnabar": [
153,
51,
51
],
"PolishedCinnabarSlab": [
153,
51,
51
],
"PolishedCinnabarStairs": [
153,
51,
51
],
"PolishedCinnabarWall": [
153,
51,
51
],
"PolishedDiorite": [
255,
252,
@ -2536,6 +2606,26 @@
109,
77
],
"PolishedSulfur": [
229,
229,
51
],
"PolishedSulfurSlab": [
229,
229,
51
],
"PolishedSulfurStairs": [
229,
229,
51
],
"PolishedSulfurWall": [
229,
229,
51
],
"Poppy": [
0,
124,
@ -2546,6 +2636,11 @@
124,
0
],
"PotentSulfur": [
250,
238,
77
],
"PowderSnow": [
255,
255,
@ -3121,6 +3216,51 @@
124,
0
],
"Sulfur": [
229,
229,
51
],
"SulfurBrickSlab": [
229,
229,
51
],
"SulfurBrickStairs": [
229,
229,
51
],
"SulfurBrickWall": [
229,
229,
51
],
"SulfurBricks": [
229,
229,
51
],
"SulfurSlab": [
229,
229,
51
],
"SulfurSpike": [
229,
229,
51
],
"SulfurStairs": [
229,
229,
51
],
"SulfurWall": [
229,
229,
51
],
"Sunflower": [
0,
124,
@ -3861,4 +4001,4 @@
150
]
}
}
}

View file

@ -1,5 +1,5 @@
{
"version": "26.1-rc-2",
"version": "26.2",
"hostile": [
"Blaze",
"Bogged",
@ -30,6 +30,7 @@
"Skeleton",
"Slime",
"Stray",
"SulfurCube",
"Vex",
"Vindicator",
"Warden",
@ -164,4 +165,4 @@
"WindCharge",
"WitherSkull"
]
}
}