mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
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:
parent
5e8d715358
commit
2af0409d00
10 changed files with 153 additions and 13 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public enum ConfigurationPacketTypesOut
|
|||
CookieResponse,
|
||||
KnownDataPacks,
|
||||
CustomClickAction, // Added in 1.21.6
|
||||
AcceptCodeOfConduct, // Added in 1.21.9
|
||||
|
||||
Unknown
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue