mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fully Implemented 1.20
This commit is contained in:
parent
b21f40593e
commit
ae7ce35cc8
14 changed files with 3313 additions and 209 deletions
|
|
@ -874,10 +874,10 @@ namespace MinecraftClient.Inventory.ItemPalettes
|
||||||
mappings[837] = ItemType.Porkchop;
|
mappings[837] = ItemType.Porkchop;
|
||||||
mappings[1048] = ItemType.Potato;
|
mappings[1048] = ItemType.Potato;
|
||||||
mappings[953] = ItemType.Potion;
|
mappings[953] = ItemType.Potion;
|
||||||
mappings[1224] = ItemType.PotteryShardArcher;
|
mappings[1224] = ItemType.ArcherPotterySherd;
|
||||||
mappings[1226] = ItemType.PotteryShardArmsUp;
|
mappings[1226] = ItemType.ArmsUpPotterySherd;
|
||||||
mappings[1225] = ItemType.PotteryShardPrize;
|
mappings[1225] = ItemType.PrizePotterySherd;
|
||||||
mappings[1227] = ItemType.PotteryShardSkull;
|
mappings[1227] = ItemType.SkullPotterySherd;
|
||||||
mappings[867] = ItemType.PowderSnowBucket;
|
mappings[867] = ItemType.PowderSnowBucket;
|
||||||
mappings[719] = ItemType.PoweredRail;
|
mappings[719] = ItemType.PoweredRail;
|
||||||
mappings[479] = ItemType.Prismarine;
|
mappings[479] = ItemType.Prismarine;
|
||||||
|
|
|
||||||
1273
MinecraftClient/Inventory/ItemPalettes/ItemPalette120.cs
Normal file
1273
MinecraftClient/Inventory/ItemPalettes/ItemPalette120.cs
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -12,7 +12,7 @@
|
||||||
public enum ItemType
|
public enum ItemType
|
||||||
{
|
{
|
||||||
Unknown = -2, // Unsupported item type (Forge mod custom item...)
|
Unknown = -2, // Unsupported item type (Forge mod custom item...)
|
||||||
Null = -1, // Unspecified item type (Used in the network protocol)
|
Null = -1, // Unspecified item type (Used in the network protocol)
|
||||||
|
|
||||||
AcaciaBoat,
|
AcaciaBoat,
|
||||||
AcaciaButton,
|
AcaciaButton,
|
||||||
|
|
@ -43,9 +43,12 @@
|
||||||
AndesiteSlab,
|
AndesiteSlab,
|
||||||
AndesiteStairs,
|
AndesiteStairs,
|
||||||
AndesiteWall,
|
AndesiteWall,
|
||||||
|
AnglerPotterySherd,
|
||||||
Anvil,
|
Anvil,
|
||||||
Apple,
|
Apple,
|
||||||
|
ArcherPotterySherd,
|
||||||
ArmorStand,
|
ArmorStand,
|
||||||
|
ArmsUpPotterySherd,
|
||||||
Arrow,
|
Arrow,
|
||||||
AxolotlBucket,
|
AxolotlBucket,
|
||||||
AxolotlSpawnEgg,
|
AxolotlSpawnEgg,
|
||||||
|
|
@ -120,6 +123,7 @@
|
||||||
BlackstoneSlab,
|
BlackstoneSlab,
|
||||||
BlackstoneStairs,
|
BlackstoneStairs,
|
||||||
BlackstoneWall,
|
BlackstoneWall,
|
||||||
|
BladePotterySherd,
|
||||||
BlastFurnace,
|
BlastFurnace,
|
||||||
BlazePowder,
|
BlazePowder,
|
||||||
BlazeRod,
|
BlazeRod,
|
||||||
|
|
@ -150,6 +154,7 @@
|
||||||
BrainCoralBlock,
|
BrainCoralBlock,
|
||||||
BrainCoralFan,
|
BrainCoralFan,
|
||||||
Bread,
|
Bread,
|
||||||
|
BrewerPotterySherd,
|
||||||
BrewingStand,
|
BrewingStand,
|
||||||
Brick,
|
Brick,
|
||||||
BrickSlab,
|
BrickSlab,
|
||||||
|
|
@ -178,9 +183,11 @@
|
||||||
Bucket,
|
Bucket,
|
||||||
BuddingAmethyst,
|
BuddingAmethyst,
|
||||||
Bundle,
|
Bundle,
|
||||||
|
BurnPotterySherd,
|
||||||
Cactus,
|
Cactus,
|
||||||
Cake,
|
Cake,
|
||||||
Calcite,
|
Calcite,
|
||||||
|
CalibratedSculkSensor,
|
||||||
CamelSpawnEgg,
|
CamelSpawnEgg,
|
||||||
Campfire,
|
Campfire,
|
||||||
Candle,
|
Candle,
|
||||||
|
|
@ -320,6 +327,7 @@
|
||||||
CyanWool,
|
CyanWool,
|
||||||
DamagedAnvil,
|
DamagedAnvil,
|
||||||
Dandelion,
|
Dandelion,
|
||||||
|
DangerPotterySherd,
|
||||||
DarkOakBoat,
|
DarkOakBoat,
|
||||||
DarkOakButton,
|
DarkOakButton,
|
||||||
DarkOakChestBoat,
|
DarkOakChestBoat,
|
||||||
|
|
@ -435,6 +443,7 @@
|
||||||
EndermiteSpawnEgg,
|
EndermiteSpawnEgg,
|
||||||
EvokerSpawnEgg,
|
EvokerSpawnEgg,
|
||||||
ExperienceBottle,
|
ExperienceBottle,
|
||||||
|
ExplorerPotterySherd,
|
||||||
ExposedCopper,
|
ExposedCopper,
|
||||||
ExposedCutCopper,
|
ExposedCutCopper,
|
||||||
ExposedCutCopperSlab,
|
ExposedCutCopperSlab,
|
||||||
|
|
@ -460,6 +469,7 @@
|
||||||
FloweringAzalea,
|
FloweringAzalea,
|
||||||
FloweringAzaleaLeaves,
|
FloweringAzaleaLeaves,
|
||||||
FoxSpawnEgg,
|
FoxSpawnEgg,
|
||||||
|
FriendPotterySherd,
|
||||||
FrogSpawnEgg,
|
FrogSpawnEgg,
|
||||||
Frogspawn,
|
Frogspawn,
|
||||||
Furnace,
|
Furnace,
|
||||||
|
|
@ -536,6 +546,8 @@
|
||||||
HangingRoots,
|
HangingRoots,
|
||||||
HayBlock,
|
HayBlock,
|
||||||
HeartOfTheSea,
|
HeartOfTheSea,
|
||||||
|
HeartPotterySherd,
|
||||||
|
HeartbreakPotterySherd,
|
||||||
HeavyWeightedPressurePlate,
|
HeavyWeightedPressurePlate,
|
||||||
HoglinSpawnEgg,
|
HoglinSpawnEgg,
|
||||||
HoneyBlock,
|
HoneyBlock,
|
||||||
|
|
@ -548,6 +560,8 @@
|
||||||
HornCoralBlock,
|
HornCoralBlock,
|
||||||
HornCoralFan,
|
HornCoralFan,
|
||||||
HorseSpawnEgg,
|
HorseSpawnEgg,
|
||||||
|
HostArmorTrimSmithingTemplate,
|
||||||
|
HowlPotterySherd,
|
||||||
HuskSpawnEgg,
|
HuskSpawnEgg,
|
||||||
Ice,
|
Ice,
|
||||||
InfestedChiseledStoneBricks,
|
InfestedChiseledStoneBricks,
|
||||||
|
|
@ -706,6 +720,7 @@
|
||||||
MelonSlice,
|
MelonSlice,
|
||||||
MilkBucket,
|
MilkBucket,
|
||||||
Minecart,
|
Minecart,
|
||||||
|
MinerPotterySherd,
|
||||||
MojangBannerPattern,
|
MojangBannerPattern,
|
||||||
MooshroomSpawnEgg,
|
MooshroomSpawnEgg,
|
||||||
MossBlock,
|
MossBlock,
|
||||||
|
|
@ -718,6 +733,7 @@
|
||||||
MossyStoneBrickStairs,
|
MossyStoneBrickStairs,
|
||||||
MossyStoneBrickWall,
|
MossyStoneBrickWall,
|
||||||
MossyStoneBricks,
|
MossyStoneBricks,
|
||||||
|
MournerPotterySherd,
|
||||||
Mud,
|
Mud,
|
||||||
MudBrickSlab,
|
MudBrickSlab,
|
||||||
MudBrickStairs,
|
MudBrickStairs,
|
||||||
|
|
@ -738,6 +754,7 @@
|
||||||
MusicDiscMellohi,
|
MusicDiscMellohi,
|
||||||
MusicDiscOtherside,
|
MusicDiscOtherside,
|
||||||
MusicDiscPigstep,
|
MusicDiscPigstep,
|
||||||
|
MusicDiscRelic,
|
||||||
MusicDiscStal,
|
MusicDiscStal,
|
||||||
MusicDiscStrad,
|
MusicDiscStrad,
|
||||||
MusicDiscWait,
|
MusicDiscWait,
|
||||||
|
|
@ -846,7 +863,10 @@
|
||||||
PinkTulip,
|
PinkTulip,
|
||||||
PinkWool,
|
PinkWool,
|
||||||
Piston,
|
Piston,
|
||||||
|
PitcherPlant,
|
||||||
|
PitcherPod,
|
||||||
PlayerHead,
|
PlayerHead,
|
||||||
|
PlentyPotterySherd,
|
||||||
Podzol,
|
Podzol,
|
||||||
PointedDripstone,
|
PointedDripstone,
|
||||||
PoisonousPotato,
|
PoisonousPotato,
|
||||||
|
|
@ -880,10 +900,6 @@
|
||||||
Porkchop,
|
Porkchop,
|
||||||
Potato,
|
Potato,
|
||||||
Potion,
|
Potion,
|
||||||
PotteryShardArcher,
|
|
||||||
PotteryShardArmsUp,
|
|
||||||
PotteryShardPrize,
|
|
||||||
PotteryShardSkull,
|
|
||||||
PowderSnowBucket,
|
PowderSnowBucket,
|
||||||
PoweredRail,
|
PoweredRail,
|
||||||
Prismarine,
|
Prismarine,
|
||||||
|
|
@ -895,6 +911,7 @@
|
||||||
PrismarineSlab,
|
PrismarineSlab,
|
||||||
PrismarineStairs,
|
PrismarineStairs,
|
||||||
PrismarineWall,
|
PrismarineWall,
|
||||||
|
PrizePotterySherd,
|
||||||
Pufferfish,
|
Pufferfish,
|
||||||
PufferfishBucket,
|
PufferfishBucket,
|
||||||
PufferfishSpawnEgg,
|
PufferfishSpawnEgg,
|
||||||
|
|
@ -930,6 +947,7 @@
|
||||||
RabbitSpawnEgg,
|
RabbitSpawnEgg,
|
||||||
RabbitStew,
|
RabbitStew,
|
||||||
Rail,
|
Rail,
|
||||||
|
RaiserArmorTrimSmithingTemplate,
|
||||||
RavagerSpawnEgg,
|
RavagerSpawnEgg,
|
||||||
RawCopper,
|
RawCopper,
|
||||||
RawCopperBlock,
|
RawCopperBlock,
|
||||||
|
|
@ -996,18 +1014,23 @@
|
||||||
SeaPickle,
|
SeaPickle,
|
||||||
Seagrass,
|
Seagrass,
|
||||||
SentryArmorTrimSmithingTemplate,
|
SentryArmorTrimSmithingTemplate,
|
||||||
|
ShaperArmorTrimSmithingTemplate,
|
||||||
|
SheafPotterySherd,
|
||||||
Shears,
|
Shears,
|
||||||
SheepSpawnEgg,
|
SheepSpawnEgg,
|
||||||
|
ShelterPotterySherd,
|
||||||
Shield,
|
Shield,
|
||||||
Shroomlight,
|
Shroomlight,
|
||||||
ShulkerBox,
|
ShulkerBox,
|
||||||
ShulkerShell,
|
ShulkerShell,
|
||||||
ShulkerSpawnEgg,
|
ShulkerSpawnEgg,
|
||||||
|
SilenceArmorTrimSmithingTemplate,
|
||||||
SilverfishSpawnEgg,
|
SilverfishSpawnEgg,
|
||||||
SkeletonHorseSpawnEgg,
|
SkeletonHorseSpawnEgg,
|
||||||
SkeletonSkull,
|
SkeletonSkull,
|
||||||
SkeletonSpawnEgg,
|
SkeletonSpawnEgg,
|
||||||
SkullBannerPattern,
|
SkullBannerPattern,
|
||||||
|
SkullPotterySherd,
|
||||||
SlimeBall,
|
SlimeBall,
|
||||||
SlimeBlock,
|
SlimeBlock,
|
||||||
SlimeSpawnEgg,
|
SlimeSpawnEgg,
|
||||||
|
|
@ -1027,7 +1050,9 @@
|
||||||
SmoothSandstoneStairs,
|
SmoothSandstoneStairs,
|
||||||
SmoothStone,
|
SmoothStone,
|
||||||
SmoothStoneSlab,
|
SmoothStoneSlab,
|
||||||
|
SnifferEgg,
|
||||||
SnifferSpawnEgg,
|
SnifferSpawnEgg,
|
||||||
|
SnortPotterySherd,
|
||||||
SnoutArmorTrimSmithingTemplate,
|
SnoutArmorTrimSmithingTemplate,
|
||||||
Snow,
|
Snow,
|
||||||
SnowBlock,
|
SnowBlock,
|
||||||
|
|
@ -1111,6 +1136,7 @@
|
||||||
Sugar,
|
Sugar,
|
||||||
SugarCane,
|
SugarCane,
|
||||||
Sunflower,
|
Sunflower,
|
||||||
|
SuspiciousGravel,
|
||||||
SuspiciousSand,
|
SuspiciousSand,
|
||||||
SuspiciousStew,
|
SuspiciousStew,
|
||||||
SweetBerries,
|
SweetBerries,
|
||||||
|
|
@ -1187,6 +1213,7 @@
|
||||||
WaxedWeatheredCutCopper,
|
WaxedWeatheredCutCopper,
|
||||||
WaxedWeatheredCutCopperSlab,
|
WaxedWeatheredCutCopperSlab,
|
||||||
WaxedWeatheredCutCopperStairs,
|
WaxedWeatheredCutCopperStairs,
|
||||||
|
WayfinderArmorTrimSmithingTemplate,
|
||||||
WeatheredCopper,
|
WeatheredCopper,
|
||||||
WeatheredCutCopper,
|
WeatheredCutCopper,
|
||||||
WeatheredCutCopperSlab,
|
WeatheredCutCopperSlab,
|
||||||
|
|
@ -1243,4 +1270,4 @@
|
||||||
ZombieVillagerSpawnEgg,
|
ZombieVillagerSpawnEgg,
|
||||||
ZombifiedPiglinSpawnEgg,
|
ZombifiedPiglinSpawnEgg,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
1663
MinecraftClient/Mapping/BlockPalettes/BlockPalette120.cs
Normal file
1663
MinecraftClient/Mapping/BlockPalettes/BlockPalette120.cs
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -16,17 +16,14 @@ public abstract class EntityMetadataPalette
|
||||||
|
|
||||||
public static EntityMetadataPalette GetPalette(int protocolVersion)
|
public static EntityMetadataPalette GetPalette(int protocolVersion)
|
||||||
{
|
{
|
||||||
if (protocolVersion <= Protocol18Handler.MC_1_8_Version)
|
return protocolVersion switch
|
||||||
return new EntityMetadataPalette18(); // 1.8
|
{
|
||||||
else if (protocolVersion <= Protocol18Handler.MC_1_12_2_Version)
|
<= Protocol18Handler.MC_1_8_Version => new EntityMetadataPalette18(), // 1.8
|
||||||
return new EntityMetadataPalette1122(); // 1.9 - 1.12.2
|
<= Protocol18Handler.MC_1_12_2_Version => new EntityMetadataPalette1122(), // 1.9 - 1.12.2
|
||||||
else if (protocolVersion <= Protocol18Handler.MC_1_19_2_Version)
|
<= Protocol18Handler.MC_1_19_2_Version => new EntityMetadataPalette1191(), // 1.13 - 1.19.2
|
||||||
return new EntityMetadataPalette1191(); // 1.13 - 1.19.2
|
<= Protocol18Handler.MC_1_19_3_Version => new EntityMetadataPalette1193(), // 1.19.3
|
||||||
else if (protocolVersion <= Protocol18Handler.MC_1_19_3_Version)
|
<= Protocol18Handler.MC_1_20_Version => new EntityMetadataPalette1194(), // 1.19.4 - 1.20 +
|
||||||
return new EntityMetadataPalette1193(); // 1.19.3
|
_ => throw new NotImplementedException()
|
||||||
else if (protocolVersion <= Protocol18Handler.MC_1_19_4_Version)
|
};
|
||||||
return new EntityMetadataPalette1194(); // 1.19.4
|
|
||||||
else
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
142
MinecraftClient/Mapping/EntityPalettes/EntityPalette120.cs
Normal file
142
MinecraftClient/Mapping/EntityPalettes/EntityPalette120.cs
Normal file
|
|
@ -0,0 +1,142 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace MinecraftClient.Mapping.EntityPalettes
|
||||||
|
{
|
||||||
|
public class EntityPalette120 : EntityPalette
|
||||||
|
{
|
||||||
|
private static readonly Dictionary<int, EntityType> mappings = new();
|
||||||
|
|
||||||
|
static EntityPalette120()
|
||||||
|
{
|
||||||
|
mappings[0] = EntityType.Allay;
|
||||||
|
mappings[1] = EntityType.AreaEffectCloud;
|
||||||
|
mappings[2] = EntityType.ArmorStand;
|
||||||
|
mappings[3] = EntityType.Arrow;
|
||||||
|
mappings[4] = EntityType.Axolotl;
|
||||||
|
mappings[5] = EntityType.Bat;
|
||||||
|
mappings[6] = EntityType.Bee;
|
||||||
|
mappings[7] = EntityType.Blaze;
|
||||||
|
mappings[8] = EntityType.BlockDisplay;
|
||||||
|
mappings[9] = EntityType.Boat;
|
||||||
|
mappings[10] = EntityType.Camel;
|
||||||
|
mappings[11] = EntityType.Cat;
|
||||||
|
mappings[12] = EntityType.CaveSpider;
|
||||||
|
mappings[13] = EntityType.ChestBoat;
|
||||||
|
mappings[14] = EntityType.ChestMinecart;
|
||||||
|
mappings[15] = EntityType.Chicken;
|
||||||
|
mappings[16] = EntityType.Cod;
|
||||||
|
mappings[17] = EntityType.CommandBlockMinecart;
|
||||||
|
mappings[18] = EntityType.Cow;
|
||||||
|
mappings[19] = EntityType.Creeper;
|
||||||
|
mappings[20] = EntityType.Dolphin;
|
||||||
|
mappings[21] = EntityType.Donkey;
|
||||||
|
mappings[22] = EntityType.DragonFireball;
|
||||||
|
mappings[23] = EntityType.Drowned;
|
||||||
|
mappings[24] = EntityType.Egg;
|
||||||
|
mappings[25] = EntityType.ElderGuardian;
|
||||||
|
mappings[26] = EntityType.EndCrystal;
|
||||||
|
mappings[27] = EntityType.EnderDragon;
|
||||||
|
mappings[28] = EntityType.EnderPearl;
|
||||||
|
mappings[29] = EntityType.Enderman;
|
||||||
|
mappings[30] = EntityType.Endermite;
|
||||||
|
mappings[31] = EntityType.Evoker;
|
||||||
|
mappings[32] = EntityType.EvokerFangs;
|
||||||
|
mappings[33] = EntityType.ExperienceBottle;
|
||||||
|
mappings[34] = EntityType.ExperienceOrb;
|
||||||
|
mappings[35] = EntityType.EyeOfEnder;
|
||||||
|
mappings[36] = EntityType.FallingBlock;
|
||||||
|
mappings[57] = EntityType.Fireball;
|
||||||
|
mappings[37] = EntityType.FireworkRocket;
|
||||||
|
mappings[123] = EntityType.FishingBobber;
|
||||||
|
mappings[38] = EntityType.Fox;
|
||||||
|
mappings[39] = EntityType.Frog;
|
||||||
|
mappings[40] = EntityType.FurnaceMinecart;
|
||||||
|
mappings[41] = EntityType.Ghast;
|
||||||
|
mappings[42] = EntityType.Giant;
|
||||||
|
mappings[43] = EntityType.GlowItemFrame;
|
||||||
|
mappings[44] = EntityType.GlowSquid;
|
||||||
|
mappings[45] = EntityType.Goat;
|
||||||
|
mappings[46] = EntityType.Guardian;
|
||||||
|
mappings[47] = EntityType.Hoglin;
|
||||||
|
mappings[48] = EntityType.HopperMinecart;
|
||||||
|
mappings[49] = EntityType.Horse;
|
||||||
|
mappings[50] = EntityType.Husk;
|
||||||
|
mappings[51] = EntityType.Illusioner;
|
||||||
|
mappings[52] = EntityType.Interaction;
|
||||||
|
mappings[53] = EntityType.IronGolem;
|
||||||
|
mappings[54] = EntityType.Item;
|
||||||
|
mappings[55] = EntityType.ItemDisplay;
|
||||||
|
mappings[56] = EntityType.ItemFrame;
|
||||||
|
mappings[58] = EntityType.LeashKnot;
|
||||||
|
mappings[59] = EntityType.LightningBolt;
|
||||||
|
mappings[60] = EntityType.Llama;
|
||||||
|
mappings[61] = EntityType.LlamaSpit;
|
||||||
|
mappings[62] = EntityType.MagmaCube;
|
||||||
|
mappings[63] = EntityType.Marker;
|
||||||
|
mappings[64] = EntityType.Minecart;
|
||||||
|
mappings[65] = EntityType.Mooshroom;
|
||||||
|
mappings[66] = EntityType.Mule;
|
||||||
|
mappings[67] = EntityType.Ocelot;
|
||||||
|
mappings[68] = EntityType.Painting;
|
||||||
|
mappings[69] = EntityType.Panda;
|
||||||
|
mappings[70] = EntityType.Parrot;
|
||||||
|
mappings[71] = EntityType.Phantom;
|
||||||
|
mappings[72] = EntityType.Pig;
|
||||||
|
mappings[73] = EntityType.Piglin;
|
||||||
|
mappings[74] = EntityType.PiglinBrute;
|
||||||
|
mappings[75] = EntityType.Pillager;
|
||||||
|
mappings[122] = EntityType.Player;
|
||||||
|
mappings[76] = EntityType.PolarBear;
|
||||||
|
mappings[77] = EntityType.Potion;
|
||||||
|
mappings[78] = EntityType.Pufferfish;
|
||||||
|
mappings[79] = EntityType.Rabbit;
|
||||||
|
mappings[80] = EntityType.Ravager;
|
||||||
|
mappings[81] = EntityType.Salmon;
|
||||||
|
mappings[82] = EntityType.Sheep;
|
||||||
|
mappings[83] = EntityType.Shulker;
|
||||||
|
mappings[84] = EntityType.ShulkerBullet;
|
||||||
|
mappings[85] = EntityType.Silverfish;
|
||||||
|
mappings[86] = EntityType.Skeleton;
|
||||||
|
mappings[87] = EntityType.SkeletonHorse;
|
||||||
|
mappings[88] = EntityType.Slime;
|
||||||
|
mappings[89] = EntityType.SmallFireball;
|
||||||
|
mappings[90] = EntityType.Sniffer;
|
||||||
|
mappings[91] = EntityType.SnowGolem;
|
||||||
|
mappings[92] = EntityType.Snowball;
|
||||||
|
mappings[93] = EntityType.SpawnerMinecart;
|
||||||
|
mappings[94] = EntityType.SpectralArrow;
|
||||||
|
mappings[95] = EntityType.Spider;
|
||||||
|
mappings[96] = EntityType.Squid;
|
||||||
|
mappings[97] = EntityType.Stray;
|
||||||
|
mappings[98] = EntityType.Strider;
|
||||||
|
mappings[99] = EntityType.Tadpole;
|
||||||
|
mappings[100] = EntityType.TextDisplay;
|
||||||
|
mappings[101] = EntityType.Tnt;
|
||||||
|
mappings[102] = EntityType.TntMinecart;
|
||||||
|
mappings[103] = EntityType.TraderLlama;
|
||||||
|
mappings[104] = EntityType.Trident;
|
||||||
|
mappings[105] = EntityType.TropicalFish;
|
||||||
|
mappings[106] = EntityType.Turtle;
|
||||||
|
mappings[107] = EntityType.Vex;
|
||||||
|
mappings[108] = EntityType.Villager;
|
||||||
|
mappings[109] = EntityType.Vindicator;
|
||||||
|
mappings[110] = EntityType.WanderingTrader;
|
||||||
|
mappings[111] = EntityType.Warden;
|
||||||
|
mappings[112] = EntityType.Witch;
|
||||||
|
mappings[113] = EntityType.Wither;
|
||||||
|
mappings[114] = EntityType.WitherSkeleton;
|
||||||
|
mappings[115] = EntityType.WitherSkull;
|
||||||
|
mappings[116] = EntityType.Wolf;
|
||||||
|
mappings[117] = EntityType.Zoglin;
|
||||||
|
mappings[118] = EntityType.Zombie;
|
||||||
|
mappings[119] = EntityType.ZombieHorse;
|
||||||
|
mappings[120] = EntityType.ZombieVillager;
|
||||||
|
mappings[121] = EntityType.ZombifiedPiglin;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Dictionary<int, EntityType> GetDict()
|
||||||
|
{
|
||||||
|
return mappings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -165,6 +165,7 @@
|
||||||
Cactus,
|
Cactus,
|
||||||
Cake,
|
Cake,
|
||||||
Calcite,
|
Calcite,
|
||||||
|
CalibratedSculkSensor,
|
||||||
Campfire,
|
Campfire,
|
||||||
Candle,
|
Candle,
|
||||||
CandleCake,
|
CandleCake,
|
||||||
|
|
@ -666,6 +667,8 @@
|
||||||
PinkWool,
|
PinkWool,
|
||||||
Piston,
|
Piston,
|
||||||
PistonHead,
|
PistonHead,
|
||||||
|
PitcherCrop,
|
||||||
|
PitcherPlant,
|
||||||
PlayerHead,
|
PlayerHead,
|
||||||
PlayerWallHead,
|
PlayerWallHead,
|
||||||
Podzol,
|
Podzol,
|
||||||
|
|
@ -842,6 +845,7 @@
|
||||||
SmoothSandstoneStairs,
|
SmoothSandstoneStairs,
|
||||||
SmoothStone,
|
SmoothStone,
|
||||||
SmoothStoneSlab,
|
SmoothStoneSlab,
|
||||||
|
SnifferEgg,
|
||||||
Snow,
|
Snow,
|
||||||
SnowBlock,
|
SnowBlock,
|
||||||
SoulCampfire,
|
SoulCampfire,
|
||||||
|
|
@ -907,6 +911,7 @@
|
||||||
StructureVoid,
|
StructureVoid,
|
||||||
SugarCane,
|
SugarCane,
|
||||||
Sunflower,
|
Sunflower,
|
||||||
|
SuspiciousGravel,
|
||||||
SuspiciousSand,
|
SuspiciousSand,
|
||||||
SweetBerryBush,
|
SweetBerryBush,
|
||||||
TallGrass,
|
TallGrass,
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace MinecraftClient
|
||||||
|
|
||||||
public const string Version = MCHighestVersion;
|
public const string Version = MCHighestVersion;
|
||||||
public const string MCLowestVersion = "1.4.6";
|
public const string MCLowestVersion = "1.4.6";
|
||||||
public const string MCHighestVersion = "1.19.4";
|
public const string MCHighestVersion = "1.20";
|
||||||
public static readonly string? BuildInfo = null;
|
public static readonly string? BuildInfo = null;
|
||||||
|
|
||||||
private static Tuple<Thread, CancellationTokenSource>? offlinePrompt = null;
|
private static Tuple<Thread, CancellationTokenSource>? offlinePrompt = null;
|
||||||
|
|
@ -860,7 +860,7 @@ namespace MinecraftClient
|
||||||
public static Type[] GetTypesInNamespace(string nameSpace, Assembly? assembly = null)
|
public static Type[] GetTypesInNamespace(string nameSpace, Assembly? assembly = null)
|
||||||
{
|
{
|
||||||
if (assembly == null) { assembly = Assembly.GetExecutingAssembly(); }
|
if (assembly == null) { assembly = Assembly.GetExecutingAssembly(); }
|
||||||
return assembly.GetTypes().Where(t => String.Equals(t.Namespace, nameSpace, StringComparison.Ordinal)).ToArray();
|
return assembly.GetTypes().Where(t => string.Equals(t.Namespace, nameSpace, StringComparison.Ordinal)).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -870,7 +870,7 @@ namespace MinecraftClient
|
||||||
{
|
{
|
||||||
if (typeof(Program)
|
if (typeof(Program)
|
||||||
.Assembly
|
.Assembly
|
||||||
.GetCustomAttributes(typeof(System.Reflection.AssemblyConfigurationAttribute), false)
|
.GetCustomAttributes(typeof(AssemblyConfigurationAttribute), false)
|
||||||
.FirstOrDefault() is AssemblyConfigurationAttribute attribute)
|
.FirstOrDefault() is AssemblyConfigurationAttribute attribute)
|
||||||
BuildInfo = attribute.Configuration;
|
BuildInfo = attribute.Configuration;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,11 +111,11 @@ namespace MinecraftClient.Protocol.Handlers.PacketPalettes
|
||||||
{ 0x66, PacketTypesIn.NBTQueryResponse }, // (Wiki name: Tab Query)
|
{ 0x66, PacketTypesIn.NBTQueryResponse }, // (Wiki name: Tab Query)
|
||||||
{ 0x67, PacketTypesIn.CollectItem }, // (Wiki name: Take Item Entity)
|
{ 0x67, PacketTypesIn.CollectItem }, // (Wiki name: Take Item Entity)
|
||||||
{ 0x68, PacketTypesIn.EntityTeleport }, // (Wiki name: Teleport Entity)
|
{ 0x68, PacketTypesIn.EntityTeleport }, // (Wiki name: Teleport Entity)
|
||||||
{ 0x69, PacketTypesIn.Advancements }, // (Wiki name: Update Advancements)
|
{ 0x69, PacketTypesIn.Advancements }, // (Wiki name: Update Advancements) (Unused)
|
||||||
{ 0x6A, PacketTypesIn.EntityProperties }, // (Wiki name: Update Attributes)
|
{ 0x6A, PacketTypesIn.EntityProperties }, // (Wiki name: Update Attributes)
|
||||||
{ 0x6B, PacketTypesIn.FeatureFlags }, // Added in 1.19.3 (Not yet clear what is the purpose of this packet)
|
{ 0x6B, PacketTypesIn.FeatureFlags }, // Added in 1.19.3 (Not yet clear what is the purpose of this packet)
|
||||||
{ 0x6C, PacketTypesIn.EntityEffect }, // Changed in 1.19 (Added "Has Factor Data" and "Factor Codec" fields) (Wiki name: Entity Effect)
|
{ 0x6C, PacketTypesIn.EntityEffect }, // Changed in 1.19 (Added "Has Factor Data" and "Factor Codec" fields) (Wiki name: Entity Effect)
|
||||||
{ 0x6D, PacketTypesIn.DeclareRecipes }, // (Wiki name: Update Recipes)
|
{ 0x6D, PacketTypesIn.DeclareRecipes }, // (Wiki name: Update Recipes) (Unused)
|
||||||
{ 0x6E, PacketTypesIn.Tags }, // (Wiki name: Update Tags)
|
{ 0x6E, PacketTypesIn.Tags }, // (Wiki name: Update Tags)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,40 +46,26 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PacketTypePalette GetTypeHandler(int protocol)
|
public PacketTypePalette GetTypeHandler(int protocol)
|
||||||
{
|
{
|
||||||
PacketTypePalette p;
|
PacketTypePalette p = protocol switch
|
||||||
if (protocol > Protocol18Handler.MC_1_19_4_Version)
|
{
|
||||||
throw new NotImplementedException(Translations.exception_palette_packet);
|
> Protocol18Handler.MC_1_20_Version => throw new NotImplementedException(Translations
|
||||||
|
.exception_palette_packet),
|
||||||
if (protocol <= Protocol18Handler.MC_1_8_Version)
|
<= Protocol18Handler.MC_1_8_Version => new PacketPalette17(),
|
||||||
p = new PacketPalette17();
|
<= Protocol18Handler.MC_1_11_2_Version => new PacketPalette110(),
|
||||||
else if (protocol <= Protocol18Handler.MC_1_11_2_Version)
|
<= Protocol18Handler.MC_1_12_Version => new PacketPalette112(),
|
||||||
p = new PacketPalette110();
|
<= Protocol18Handler.MC_1_12_2_Version => new PacketPalette1122(),
|
||||||
else if (protocol <= Protocol18Handler.MC_1_12_Version)
|
< Protocol18Handler.MC_1_14_Version => new PacketPalette113(),
|
||||||
p = new PacketPalette112();
|
< Protocol18Handler.MC_1_15_Version => new PacketPalette114(),
|
||||||
else if (protocol <= Protocol18Handler.MC_1_12_2_Version)
|
<= Protocol18Handler.MC_1_15_2_Version => new PacketPalette115(),
|
||||||
p = new PacketPalette1122();
|
<= Protocol18Handler.MC_1_16_1_Version => new PacketPalette116(),
|
||||||
else if (protocol < Protocol18Handler.MC_1_14_Version)
|
<= Protocol18Handler.MC_1_16_5_Version => new PacketPalette1162(),
|
||||||
p = new PacketPalette113();
|
<= Protocol18Handler.MC_1_17_1_Version => new PacketPalette117(),
|
||||||
else if (protocol < Protocol18Handler.MC_1_15_Version)
|
<= Protocol18Handler.MC_1_18_2_Version => new PacketPalette118(),
|
||||||
p = new PacketPalette114();
|
<= Protocol18Handler.MC_1_19_Version => new PacketPalette119(),
|
||||||
else if (protocol <= Protocol18Handler.MC_1_15_2_Version)
|
<= Protocol18Handler.MC_1_19_2_Version => new PacketPalette1192(),
|
||||||
p = new PacketPalette115();
|
<= Protocol18Handler.MC_1_19_3_Version => new PacketPalette1193(),
|
||||||
else if (protocol <= Protocol18Handler.MC_1_16_1_Version)
|
_ => new PacketPalette1194()
|
||||||
p = new PacketPalette116();
|
};
|
||||||
else if (protocol <= Protocol18Handler.MC_1_16_5_Version)
|
|
||||||
p = new PacketPalette1162();
|
|
||||||
else if (protocol <= Protocol18Handler.MC_1_17_1_Version)
|
|
||||||
p = new PacketPalette117();
|
|
||||||
else if (protocol <= Protocol18Handler.MC_1_18_2_Version)
|
|
||||||
p = new PacketPalette118();
|
|
||||||
else if (protocol <= Protocol18Handler.MC_1_19_Version)
|
|
||||||
p = new PacketPalette119();
|
|
||||||
else if (protocol <= Protocol18Handler.MC_1_19_2_Version)
|
|
||||||
p = new PacketPalette1192();
|
|
||||||
else if (protocol <= Protocol18Handler.MC_1_19_3_Version)
|
|
||||||
p = new PacketPalette1193();
|
|
||||||
else
|
|
||||||
p = new PacketPalette1194();
|
|
||||||
|
|
||||||
p.SetForgeEnabled(forgeEnabled);
|
p.SetForgeEnabled(forgeEnabled);
|
||||||
return p;
|
return p;
|
||||||
|
|
|
||||||
|
|
@ -711,7 +711,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
catch (SocketException) { return false; }
|
catch (SocketException) { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SendUpdateSign(Location location, string line1, string line2, string line3, string line4)
|
public bool SendUpdateSign(Location location, string line1, string line2, string line3, string line4, bool isFrontText = true)
|
||||||
{
|
{
|
||||||
return false; //Currently not implemented
|
return false; //Currently not implemented
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
internal const int MC_1_19_2_Version = 760;
|
internal const int MC_1_19_2_Version = 760;
|
||||||
internal const int MC_1_19_3_Version = 761;
|
internal const int MC_1_19_3_Version = 761;
|
||||||
internal const int MC_1_19_4_Version = 762;
|
internal const int MC_1_19_4_Version = 762;
|
||||||
|
internal const int MC_1_20_Version = 763;
|
||||||
|
|
||||||
private int compression_treshold = 0;
|
private int compression_treshold = 0;
|
||||||
private int autocomplete_transaction_id = 0;
|
private int autocomplete_transaction_id = 0;
|
||||||
|
|
@ -113,97 +114,79 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
randomGen = RandomNumberGenerator.Create();
|
randomGen = RandomNumberGenerator.Create();
|
||||||
lastSeenMessagesCollector = protocolVersion >= MC_1_19_3_Version ? new(20) : new(5);
|
lastSeenMessagesCollector = protocolVersion >= MC_1_19_3_Version ? new(20) : new(5);
|
||||||
|
|
||||||
if (handler.GetTerrainEnabled() && protocolVersion > MC_1_19_4_Version)
|
if (handler.GetTerrainEnabled() && protocolVersion > MC_1_20_Version)
|
||||||
{
|
{
|
||||||
log.Error("§c" + Translations.extra_terrainandmovement_disabled);
|
log.Error("§c" + Translations.extra_terrainandmovement_disabled);
|
||||||
handler.SetTerrainEnabled(false);
|
handler.SetTerrainEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handler.GetInventoryEnabled() &&
|
if (handler.GetInventoryEnabled() &&
|
||||||
(protocolVersion < MC_1_9_Version || protocolVersion > MC_1_19_4_Version))
|
protocolVersion is < MC_1_9_Version or > MC_1_20_Version)
|
||||||
{
|
{
|
||||||
log.Error("§c" + Translations.extra_inventory_disabled);
|
log.Error("§c" + Translations.extra_inventory_disabled);
|
||||||
handler.SetInventoryEnabled(false);
|
handler.SetInventoryEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handler.GetEntityHandlingEnabled() &&
|
if (handler.GetEntityHandlingEnabled() &&
|
||||||
(protocolVersion < MC_1_8_Version || protocolVersion > MC_1_19_4_Version))
|
protocolVersion is < MC_1_8_Version or > MC_1_20_Version)
|
||||||
{
|
{
|
||||||
log.Error("§c" + Translations.extra_entity_disabled);
|
log.Error("§c" + Translations.extra_entity_disabled);
|
||||||
handler.SetEntityHandlingEnabled(false);
|
handler.SetEntityHandlingEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Block palette
|
Block.Palette = protocolVersion switch
|
||||||
if (protocolVersion > MC_1_19_4_Version && handler.GetTerrainEnabled())
|
{
|
||||||
throw new NotImplementedException(Translations.exception_palette_block);
|
// Block palette
|
||||||
|
> MC_1_20_Version when handler.GetTerrainEnabled() =>
|
||||||
|
throw new NotImplementedException(Translations.exception_palette_block),
|
||||||
|
MC_1_20_Version => new Palette120(),
|
||||||
|
MC_1_19_4_Version => new Palette1194(),
|
||||||
|
MC_1_19_3_Version => new Palette1193(),
|
||||||
|
>= MC_1_19_Version => new Palette119(),
|
||||||
|
>= MC_1_17_Version => new Palette117(),
|
||||||
|
>= MC_1_16_Version => new Palette116(),
|
||||||
|
>= MC_1_15_Version => new Palette115(),
|
||||||
|
>= MC_1_14_Version => new Palette114(),
|
||||||
|
>= MC_1_13_Version => new Palette113(),
|
||||||
|
_ => new Palette112()
|
||||||
|
};
|
||||||
|
|
||||||
if (protocolVersion >= MC_1_19_4_Version)
|
entityPalette = protocolVersion switch
|
||||||
Block.Palette = new Palette1194();
|
{
|
||||||
else if (protocolVersion >= MC_1_19_3_Version)
|
// Entity palette
|
||||||
Block.Palette = new Palette1193();
|
> MC_1_20_Version when handler.GetEntityHandlingEnabled() =>
|
||||||
else if (protocolVersion >= MC_1_19_Version)
|
throw new NotImplementedException(Translations.exception_palette_entity),
|
||||||
Block.Palette = new Palette119();
|
MC_1_20_Version => new EntityPalette120(),
|
||||||
else if (protocolVersion >= MC_1_17_Version)
|
MC_1_19_4_Version => new EntityPalette1194(),
|
||||||
Block.Palette = new Palette117();
|
MC_1_19_3_Version => new EntityPalette1193(),
|
||||||
else if (protocolVersion >= MC_1_16_Version)
|
>= MC_1_19_Version => new EntityPalette119(),
|
||||||
Block.Palette = new Palette116();
|
>= MC_1_17_Version => new EntityPalette117(),
|
||||||
else if (protocolVersion >= MC_1_15_Version)
|
>= MC_1_16_2_Version => new EntityPalette1162(),
|
||||||
Block.Palette = new Palette115();
|
>= MC_1_16_Version => new EntityPalette1161(),
|
||||||
else if (protocolVersion >= MC_1_14_Version)
|
>= MC_1_15_Version => new EntityPalette115(),
|
||||||
Block.Palette = new Palette114();
|
>= MC_1_14_Version => new EntityPalette114(),
|
||||||
else if (protocolVersion >= MC_1_13_Version)
|
>= MC_1_13_Version => new EntityPalette113(),
|
||||||
Block.Palette = new Palette113();
|
>= MC_1_12_Version => new EntityPalette112(),
|
||||||
else
|
_ => new EntityPalette18()
|
||||||
Block.Palette = new Palette112();
|
};
|
||||||
|
|
||||||
// Entity palette
|
|
||||||
if (protocolVersion > MC_1_19_4_Version && handler.GetEntityHandlingEnabled())
|
|
||||||
throw new NotImplementedException(Translations.exception_palette_entity);
|
|
||||||
|
|
||||||
if (protocolVersion >= MC_1_19_4_Version)
|
|
||||||
entityPalette = new EntityPalette1194();
|
|
||||||
else if (protocolVersion >= MC_1_19_3_Version)
|
|
||||||
entityPalette = new EntityPalette1193();
|
|
||||||
else if (protocolVersion >= MC_1_19_Version)
|
|
||||||
entityPalette = new EntityPalette119();
|
|
||||||
else if (protocolVersion >= MC_1_17_Version)
|
|
||||||
entityPalette = new EntityPalette117();
|
|
||||||
else if (protocolVersion >= MC_1_16_2_Version)
|
|
||||||
entityPalette = new EntityPalette1162();
|
|
||||||
else if (protocolVersion >= MC_1_16_Version)
|
|
||||||
entityPalette = new EntityPalette1161();
|
|
||||||
else if (protocolVersion >= MC_1_15_Version)
|
|
||||||
entityPalette = new EntityPalette115();
|
|
||||||
else if (protocolVersion >= MC_1_14_Version)
|
|
||||||
entityPalette = new EntityPalette114();
|
|
||||||
else if (protocolVersion >= MC_1_13_Version)
|
|
||||||
entityPalette = new EntityPalette113();
|
|
||||||
else if (protocolVersion >= MC_1_12_Version)
|
|
||||||
entityPalette = new EntityPalette112();
|
|
||||||
else entityPalette = new EntityPalette18();
|
|
||||||
|
|
||||||
entityMetadataPalette = EntityMetadataPalette.GetPalette(protocolVersion);
|
entityMetadataPalette = EntityMetadataPalette.GetPalette(protocolVersion);
|
||||||
|
|
||||||
// Item palette
|
itemPalette = protocolVersion switch
|
||||||
if (protocolVersion > MC_1_19_4_Version && handler.GetInventoryEnabled())
|
{
|
||||||
throw new NotImplementedException(Translations.exception_palette_item);
|
// Item palette
|
||||||
|
> MC_1_20_Version when handler.GetInventoryEnabled() =>
|
||||||
if (protocolVersion >= MC_1_19_4_Version)
|
throw new NotImplementedException(Translations.exception_palette_item),
|
||||||
itemPalette = new ItemPalette1194();
|
MC_1_20_Version => new ItemPalette120(),
|
||||||
else if (protocolVersion >= MC_1_19_3_Version)
|
MC_1_19_4_Version => new ItemPalette1194(),
|
||||||
itemPalette = new ItemPalette1193();
|
MC_1_19_3_Version => new ItemPalette1193(),
|
||||||
else if (protocolVersion >= MC_1_19_Version)
|
>= MC_1_19_Version => new ItemPalette119(),
|
||||||
itemPalette = new ItemPalette119();
|
>= MC_1_18_1_Version => new ItemPalette118(),
|
||||||
else if (protocolVersion >= MC_1_18_1_Version)
|
>= MC_1_17_Version => new ItemPalette117(),
|
||||||
itemPalette = new ItemPalette118();
|
>= MC_1_16_2_Version => new ItemPalette1162(),
|
||||||
else if (protocolVersion >= MC_1_17_Version)
|
>= MC_1_16_1_Version => new ItemPalette1161(),
|
||||||
itemPalette = new ItemPalette117();
|
_ => new ItemPalette115()
|
||||||
else if (protocolVersion >= MC_1_16_2_Version)
|
};
|
||||||
itemPalette = new ItemPalette1162();
|
|
||||||
else if (protocolVersion >= MC_1_16_1_Version)
|
|
||||||
itemPalette = new ItemPalette1161();
|
|
||||||
else
|
|
||||||
itemPalette = new ItemPalette115();
|
|
||||||
|
|
||||||
// MessageType
|
// MessageType
|
||||||
// You can find it in https://wiki.vg/Protocol#Player_Chat_Message or /net/minecraft/network/message/MessageType.java
|
// You can find it in https://wiki.vg/Protocol#Player_Chat_Message or /net/minecraft/network/message/MessageType.java
|
||||||
|
|
@ -522,7 +505,10 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
dataTypes.ReadNextLocation(packetData); // Death location
|
dataTypes.ReadNextLocation(packetData); // Death location
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (protocolVersion >= MC_1_20_Version)
|
||||||
|
dataTypes.ReadNextVarInt(packetData); // Portal Cooldown - 1.20 and above
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PacketTypesIn.SpawnPainting: // Just skip, no need for this
|
case PacketTypesIn.SpawnPainting: // Just skip, no need for this
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -880,7 +866,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
dataTypes.SkipNextVarInt(packetData);
|
dataTypes.SkipNextVarInt(packetData);
|
||||||
|
|
||||||
handler.OnPlayerKilled(
|
handler.OnPlayerKilled(
|
||||||
dataTypes.ReadNextInt(packetData),
|
protocolVersion >= MC_1_20_Version ? -1 : dataTypes.ReadNextInt(packetData),
|
||||||
ChatParser.ParseText(dataTypes.ReadNextString(packetData))
|
ChatParser.ParseText(dataTypes.ReadNextString(packetData))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -1009,6 +995,9 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (protocolVersion >= MC_1_20_Version)
|
||||||
|
dataTypes.ReadNextVarInt(packetData); // Portal Cooldown
|
||||||
|
|
||||||
handler.OnRespawn();
|
handler.OnRespawn();
|
||||||
break;
|
break;
|
||||||
case PacketTypesIn.PlayerPositionAndLook:
|
case PacketTypesIn.PlayerPositionAndLook:
|
||||||
|
|
@ -1103,6 +1092,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
Interlocked.Decrement(ref handler.GetWorld().chunkLoadNotCompleted);
|
Interlocked.Decrement(ref handler.GetWorld().chunkLoadNotCompleted);
|
||||||
|
|
||||||
// Block Entity data: ignored
|
// Block Entity data: ignored
|
||||||
|
// Trust edges: ignored (Removed in 1.20)
|
||||||
// Light data: ignored
|
// Light data: ignored
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1359,7 +1349,10 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
int sectionX = (int)(chunkSection >> 42);
|
int sectionX = (int)(chunkSection >> 42);
|
||||||
int sectionY = (int)((chunkSection << 44) >> 44);
|
int sectionY = (int)((chunkSection << 44) >> 44);
|
||||||
int sectionZ = (int)((chunkSection << 22) >> 42);
|
int sectionZ = (int)((chunkSection << 22) >> 42);
|
||||||
dataTypes.ReadNextBool(packetData); // Useless boolean (Related to light update)
|
|
||||||
|
if(protocolVersion < MC_1_20_Version)
|
||||||
|
dataTypes.ReadNextBool(packetData); // Useless boolean (Related to light update)
|
||||||
|
|
||||||
int blocksSize = dataTypes.ReadNextVarInt(packetData);
|
int blocksSize = dataTypes.ReadNextVarInt(packetData);
|
||||||
for (int i = 0; i < blocksSize; i++)
|
for (int i = 0; i < blocksSize; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -2188,22 +2181,23 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
dataTypes.ReadNextMetadata(packetData, itemPalette, entityMetadataPalette);
|
dataTypes.ReadNextMetadata(packetData, itemPalette, entityMetadataPalette);
|
||||||
|
|
||||||
// Also make a palette for field? Will be a lot of work
|
// Also make a palette for field? Will be a lot of work
|
||||||
int healthField; // See https://wiki.vg/Entity_metadata#Living_Entity
|
int healthField = protocolVersion switch
|
||||||
if (protocolVersion > MC_1_19_4_Version)
|
{
|
||||||
throw new NotImplementedException(Translations.exception_palette_healthfield);
|
> MC_1_20_Version => throw new NotImplementedException(Translations
|
||||||
else if (protocolVersion >= MC_1_17_Version) // 1.17 and above
|
.exception_palette_healthfield),
|
||||||
healthField = 9;
|
// 1.17 and above
|
||||||
else if (protocolVersion >= MC_1_14_Version) // 1.14 and above
|
>= MC_1_17_Version => 9,
|
||||||
healthField = 8;
|
// 1.14 and above
|
||||||
else if (protocolVersion >= MC_1_10_Version) // 1.10 and above
|
>= MC_1_14_Version => 8,
|
||||||
healthField = 7;
|
// 1.10 and above
|
||||||
else if (protocolVersion >= MC_1_8_Version) // 1.8 and above
|
>= MC_1_10_Version => 7,
|
||||||
healthField = 6;
|
// 1.8 and above
|
||||||
else
|
>= MC_1_8_Version => 6,
|
||||||
throw new NotImplementedException(Translations.exception_palette_healthfield);
|
_ => throw new NotImplementedException(Translations.exception_palette_healthfield)
|
||||||
|
};
|
||||||
|
|
||||||
if (metadata.TryGetValue(healthField, out object? healthObj) && healthObj != null &&
|
if (metadata.TryGetValue(healthField, out var healthObj) && healthObj != null &&
|
||||||
healthObj.GetType() == typeof(float))
|
healthObj is float)
|
||||||
handler.OnEntityHealth(EntityID, (float)healthObj);
|
handler.OnEntityHealth(EntityID, (float)healthObj);
|
||||||
|
|
||||||
handler.OnEntityMetadata(EntityID, metadata);
|
handler.OnEntityMetadata(EntityID, metadata);
|
||||||
|
|
@ -2343,6 +2337,17 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PacketTypesIn.OpenSignEditor:
|
||||||
|
var signLocation = dataTypes.ReadNextLocation(packetData);
|
||||||
|
var isFrontText = true;
|
||||||
|
|
||||||
|
if (protocolVersion >= MC_1_20_Version)
|
||||||
|
isFrontText = dataTypes.ReadNextBool(packetData);
|
||||||
|
|
||||||
|
// TODO: Use
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false; //Ignored packet
|
return false; //Ignored packet
|
||||||
}
|
}
|
||||||
|
|
@ -3950,7 +3955,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SendUpdateSign(Location sign, string line1, string line2, string line3, string line4)
|
public bool SendUpdateSign(Location sign, string line1, string line2, string line3, string line4, bool isFrontText = true)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -3965,6 +3970,8 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
List<byte> packet = new();
|
List<byte> packet = new();
|
||||||
packet.AddRange(dataTypes.GetLocation(sign));
|
packet.AddRange(dataTypes.GetLocation(sign));
|
||||||
|
if(protocolVersion >= MC_1_20_Version)
|
||||||
|
packet.AddRange(dataTypes.GetBool((isFrontText)));
|
||||||
packet.AddRange(dataTypes.GetString(line1));
|
packet.AddRange(dataTypes.GetString(line1));
|
||||||
packet.AddRange(dataTypes.GetString(line2));
|
packet.AddRange(dataTypes.GetString(line2));
|
||||||
packet.AddRange(dataTypes.GetString(line3));
|
packet.AddRange(dataTypes.GetString(line3));
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ namespace MinecraftClient.Protocol
|
||||||
/// <param name="location">Location</param>
|
/// <param name="location">Location</param>
|
||||||
/// <param name="face">Block face</param>
|
/// <param name="face">Block face</param>
|
||||||
/// <param name="sequenceId">Sequence ID (use for synchronization)</param>
|
/// <param name="sequenceId">Sequence ID (use for synchronization)</param>
|
||||||
/// <returns>True if packet was succcessfully sent</returns>
|
/// <returns>True if packet was successfully sent</returns>
|
||||||
bool SendPlayerDigging(int status, Location location, Direction face, int sequenceId);
|
bool SendPlayerDigging(int status, Location location, Direction face, int sequenceId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -231,8 +231,9 @@ namespace MinecraftClient.Protocol
|
||||||
/// <param name="line2">New line 2</param>
|
/// <param name="line2">New line 2</param>
|
||||||
/// <param name="line3">New line 3</param>
|
/// <param name="line3">New line 3</param>
|
||||||
/// <param name="line4">New line 4</param>
|
/// <param name="line4">New line 4</param>
|
||||||
/// <returns>True if packet was succcessfully sent</returns>
|
/// <param name="isFrontText">Are we editing the front or the back of the sign. 1.20 +</param>
|
||||||
bool SendUpdateSign(Location location, string line1, string line2, string line3, string line4);
|
/// <returns>True if packet was successfully sent</returns>
|
||||||
|
bool SendUpdateSign(Location location, string line1, string line2, string line3, string line4, bool isFrontText = true);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update command block
|
/// Update command block
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ namespace MinecraftClient.Protocol
|
||||||
if (Array.IndexOf(supportedVersions_Protocol16, ProtocolVersion) > -1)
|
if (Array.IndexOf(supportedVersions_Protocol16, ProtocolVersion) > -1)
|
||||||
return new Protocol16Handler(Client, ProtocolVersion, Handler);
|
return new Protocol16Handler(Client, ProtocolVersion, Handler);
|
||||||
|
|
||||||
int[] supportedVersions_Protocol18 = { 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 };
|
int[] supportedVersions_Protocol18 = { 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 };
|
||||||
|
|
||||||
if (Array.IndexOf(supportedVersions_Protocol18, ProtocolVersion) > -1)
|
if (Array.IndexOf(supportedVersions_Protocol18, ProtocolVersion) > -1)
|
||||||
return new Protocol18Handler(Client, ProtocolVersion, Handler, forgeInfo);
|
return new Protocol18Handler(Client, ProtocolVersion, Handler, forgeInfo);
|
||||||
|
|
@ -317,6 +317,8 @@ namespace MinecraftClient.Protocol
|
||||||
return 761;
|
return 761;
|
||||||
case "1.19.4":
|
case "1.19.4":
|
||||||
return 762;
|
return 762;
|
||||||
|
case "1.20":
|
||||||
|
return 763;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -325,7 +327,7 @@ namespace MinecraftClient.Protocol
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return Int32.Parse(MCVersion, NumberStyles.Any, CultureInfo.CurrentCulture);
|
return int.Parse(MCVersion, NumberStyles.Any, CultureInfo.CurrentCulture);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
@ -342,61 +344,62 @@ namespace MinecraftClient.Protocol
|
||||||
/// <returns>The 1.X.X version number, or 0.0 if could not determine protocol version</returns>
|
/// <returns>The 1.X.X version number, or 0.0 if could not determine protocol version</returns>
|
||||||
public static string ProtocolVersion2MCVer(int protocol)
|
public static string ProtocolVersion2MCVer(int protocol)
|
||||||
{
|
{
|
||||||
switch (protocol)
|
return protocol switch
|
||||||
{
|
{
|
||||||
case 22: return "1.0";
|
22 => "1.0",
|
||||||
case 23: return "1.1";
|
23 => "1.1",
|
||||||
case 28: return "1.2.3";
|
28 => "1.2.3",
|
||||||
case 29: return "1.2.5";
|
29 => "1.2.5",
|
||||||
case 39: return "1.3.2";
|
39 => "1.3.2",
|
||||||
// case 47: return "1.4.2";
|
// case 47: return "1.4.2";
|
||||||
case 48: return "1.4.3";
|
48 => "1.4.3",
|
||||||
case 49: return "1.4.5";
|
49 => "1.4.5",
|
||||||
case 51: return "1.4.6";
|
51 => "1.4.6",
|
||||||
case 60: return "1.5.1";
|
60 => "1.5.1",
|
||||||
case 62: return "1.5.2";
|
62 => "1.5.2",
|
||||||
case 72: return "1.6";
|
72 => "1.6",
|
||||||
case 73: return "1.6.1";
|
73 => "1.6.1",
|
||||||
case 3: return "1.7.1";
|
3 => "1.7.1",
|
||||||
case 4: return "1.7.2";
|
4 => "1.7.2",
|
||||||
case 5: return "1.7.6";
|
5 => "1.7.6",
|
||||||
case 47: return "1.8";
|
47 => "1.8",
|
||||||
case 107: return "1.9";
|
107 => "1.9",
|
||||||
case 108: return "1.9.1";
|
108 => "1.9.1",
|
||||||
case 109: return "1.9.2";
|
109 => "1.9.2",
|
||||||
case 110: return "1.9.3";
|
110 => "1.9.3",
|
||||||
case 210: return "1.10";
|
210 => "1.10",
|
||||||
case 315: return "1.11";
|
315 => "1.11",
|
||||||
case 316: return "1.11.1";
|
316 => "1.11.1",
|
||||||
case 335: return "1.12";
|
335 => "1.12",
|
||||||
case 338: return "1.12.1";
|
338 => "1.12.1",
|
||||||
case 340: return "1.12.2";
|
340 => "1.12.2",
|
||||||
case 393: return "1.13";
|
393 => "1.13",
|
||||||
case 401: return "1.13.1";
|
401 => "1.13.1",
|
||||||
case 404: return "1.13.2";
|
404 => "1.13.2",
|
||||||
case 477: return "1.14";
|
477 => "1.14",
|
||||||
case 480: return "1.14.1";
|
480 => "1.14.1",
|
||||||
case 485: return "1.14.2";
|
485 => "1.14.2",
|
||||||
case 490: return "1.14.3";
|
490 => "1.14.3",
|
||||||
case 498: return "1.14.4";
|
498 => "1.14.4",
|
||||||
case 573: return "1.15";
|
573 => "1.15",
|
||||||
case 575: return "1.15.1";
|
575 => "1.15.1",
|
||||||
case 578: return "1.15.2";
|
578 => "1.15.2",
|
||||||
case 735: return "1.16";
|
735 => "1.16",
|
||||||
case 736: return "1.16.1";
|
736 => "1.16.1",
|
||||||
case 751: return "1.16.2";
|
751 => "1.16.2",
|
||||||
case 753: return "1.16.3";
|
753 => "1.16.3",
|
||||||
case 754: return "1.16.5";
|
754 => "1.16.5",
|
||||||
case 755: return "1.17";
|
755 => "1.17",
|
||||||
case 756: return "1.17.1";
|
756 => "1.17.1",
|
||||||
case 757: return "1.18.1";
|
757 => "1.18.1",
|
||||||
case 758: return "1.18.2";
|
758 => "1.18.2",
|
||||||
case 759: return "1.19";
|
759 => "1.19",
|
||||||
case 760: return "1.19.2";
|
760 => "1.19.2",
|
||||||
case 761: return "1.19.3";
|
761 => "1.19.3",
|
||||||
case 762: return "1.19.4";
|
762 => "1.19.4",
|
||||||
default: return "0.0";
|
763 => "1.20",
|
||||||
}
|
_ => "0.0"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue