Add support for Minecraft 1.15

See #834
This commit is contained in:
ORelio 2019-12-14 14:22:24 +01:00
parent 52d98538b3
commit c6f00ce686
9 changed files with 1863 additions and 7 deletions

File diff suppressed because it is too large Load diff

View file

@ -690,5 +690,9 @@
StructureBlock, StructureBlock,
Jigsaw, Jigsaw,
Composter, Composter,
BeeNest,
Beehive,
HoneyBlock,
HoneycombBlock,
} }
} }

View file

@ -0,0 +1,686 @@
namespace MinecraftClient.Mapping
{
public enum Material
{
Air,
Stone,
Granite,
PolishedGranite,
Diorite,
PolishedDiorite,
Andesite,
PolishedAndesite,
GrassBlock,
Dirt,
CoarseDirt,
Podzol,
Cobblestone,
OakPlanks,
SprucePlanks,
BirchPlanks,
JunglePlanks,
AcaciaPlanks,
DarkOakPlanks,
OakSapling,
SpruceSapling,
BirchSapling,
JungleSapling,
AcaciaSapling,
DarkOakSapling,
Bedrock,
Water,
Lava,
Sand,
RedSand,
Gravel,
GoldOre,
IronOre,
CoalOre,
OakLog,
SpruceLog,
BirchLog,
JungleLog,
AcaciaLog,
DarkOakLog,
StrippedSpruceLog,
StrippedBirchLog,
StrippedJungleLog,
StrippedAcaciaLog,
StrippedDarkOakLog,
StrippedOakLog,
OakWood,
SpruceWood,
BirchWood,
JungleWood,
AcaciaWood,
DarkOakWood,
StrippedOakWood,
StrippedSpruceWood,
StrippedBirchWood,
StrippedJungleWood,
StrippedAcaciaWood,
StrippedDarkOakWood,
OakLeaves,
SpruceLeaves,
BirchLeaves,
JungleLeaves,
AcaciaLeaves,
DarkOakLeaves,
Sponge,
WetSponge,
Glass,
LapisOre,
LapisBlock,
Dispenser,
Sandstone,
ChiseledSandstone,
CutSandstone,
NoteBlock,
WhiteBed,
OrangeBed,
MagentaBed,
LightBlueBed,
YellowBed,
LimeBed,
PinkBed,
GrayBed,
LightGrayBed,
CyanBed,
PurpleBed,
BlueBed,
BrownBed,
GreenBed,
RedBed,
BlackBed,
PoweredRail,
DetectorRail,
StickyPiston,
Cobweb,
Grass,
Fern,
DeadBush,
Seagrass,
TallSeagrass,
Piston,
PistonHead,
WhiteWool,
OrangeWool,
MagentaWool,
LightBlueWool,
YellowWool,
LimeWool,
PinkWool,
GrayWool,
LightGrayWool,
CyanWool,
PurpleWool,
BlueWool,
BrownWool,
GreenWool,
RedWool,
BlackWool,
MovingPiston,
Dandelion,
Poppy,
BlueOrchid,
Allium,
AzureBluet,
RedTulip,
OrangeTulip,
WhiteTulip,
PinkTulip,
OxeyeDaisy,
Cornflower,
WitherRose,
LilyOfTheValley,
BrownMushroom,
RedMushroom,
GoldBlock,
IronBlock,
Bricks,
Tnt,
Bookshelf,
MossyCobblestone,
Obsidian,
Torch,
WallTorch,
Fire,
Spawner,
OakStairs,
Chest,
RedstoneWire,
DiamondOre,
DiamondBlock,
CraftingTable,
Wheat,
Farmland,
Furnace,
OakSign,
SpruceSign,
BirchSign,
AcaciaSign,
JungleSign,
DarkOakSign,
OakDoor,
Ladder,
Rail,
CobblestoneStairs,
OakWallSign,
SpruceWallSign,
BirchWallSign,
AcaciaWallSign,
JungleWallSign,
DarkOakWallSign,
Lever,
StonePressurePlate,
IronDoor,
OakPressurePlate,
SprucePressurePlate,
BirchPressurePlate,
JunglePressurePlate,
AcaciaPressurePlate,
DarkOakPressurePlate,
RedstoneOre,
RedstoneTorch,
RedstoneWallTorch,
StoneButton,
Snow,
Ice,
SnowBlock,
Cactus,
Clay,
SugarCane,
Jukebox,
OakFence,
Pumpkin,
Netherrack,
SoulSand,
Glowstone,
NetherPortal,
CarvedPumpkin,
JackOLantern,
Cake,
Repeater,
WhiteStainedGlass,
OrangeStainedGlass,
MagentaStainedGlass,
LightBlueStainedGlass,
YellowStainedGlass,
LimeStainedGlass,
PinkStainedGlass,
GrayStainedGlass,
LightGrayStainedGlass,
CyanStainedGlass,
PurpleStainedGlass,
BlueStainedGlass,
BrownStainedGlass,
GreenStainedGlass,
RedStainedGlass,
BlackStainedGlass,
OakTrapdoor,
SpruceTrapdoor,
BirchTrapdoor,
JungleTrapdoor,
AcaciaTrapdoor,
DarkOakTrapdoor,
StoneBricks,
MossyStoneBricks,
CrackedStoneBricks,
ChiseledStoneBricks,
InfestedStone,
InfestedCobblestone,
InfestedStoneBricks,
InfestedMossyStoneBricks,
InfestedCrackedStoneBricks,
InfestedChiseledStoneBricks,
BrownMushroomBlock,
RedMushroomBlock,
MushroomStem,
IronBars,
GlassPane,
Melon,
AttachedPumpkinStem,
AttachedMelonStem,
PumpkinStem,
MelonStem,
Vine,
OakFenceGate,
BrickStairs,
StoneBrickStairs,
Mycelium,
LilyPad,
NetherBricks,
NetherBrickFence,
NetherBrickStairs,
NetherWart,
EnchantingTable,
BrewingStand,
Cauldron,
EndPortal,
EndPortalFrame,
EndStone,
DragonEgg,
RedstoneLamp,
Cocoa,
SandstoneStairs,
EmeraldOre,
EnderChest,
TripwireHook,
Tripwire,
EmeraldBlock,
SpruceStairs,
BirchStairs,
JungleStairs,
CommandBlock,
Beacon,
CobblestoneWall,
MossyCobblestoneWall,
FlowerPot,
PottedOakSapling,
PottedSpruceSapling,
PottedBirchSapling,
PottedJungleSapling,
PottedAcaciaSapling,
PottedDarkOakSapling,
PottedFern,
PottedDandelion,
PottedPoppy,
PottedBlueOrchid,
PottedAllium,
PottedAzureBluet,
PottedRedTulip,
PottedOrangeTulip,
PottedWhiteTulip,
PottedPinkTulip,
PottedOxeyeDaisy,
PottedCornflower,
PottedLilyOfTheValley,
PottedWitherRose,
PottedRedMushroom,
PottedBrownMushroom,
PottedDeadBush,
PottedCactus,
Carrots,
Potatoes,
OakButton,
SpruceButton,
BirchButton,
JungleButton,
AcaciaButton,
DarkOakButton,
SkeletonSkull,
SkeletonWallSkull,
WitherSkeletonSkull,
WitherSkeletonWallSkull,
ZombieHead,
ZombieWallHead,
PlayerHead,
PlayerWallHead,
CreeperHead,
CreeperWallHead,
DragonHead,
DragonWallHead,
Anvil,
ChippedAnvil,
DamagedAnvil,
TrappedChest,
LightWeightedPressurePlate,
HeavyWeightedPressurePlate,
Comparator,
DaylightDetector,
RedstoneBlock,
NetherQuartzOre,
Hopper,
QuartzBlock,
ChiseledQuartzBlock,
QuartzPillar,
QuartzStairs,
ActivatorRail,
Dropper,
WhiteTerracotta,
OrangeTerracotta,
MagentaTerracotta,
LightBlueTerracotta,
YellowTerracotta,
LimeTerracotta,
PinkTerracotta,
GrayTerracotta,
LightGrayTerracotta,
CyanTerracotta,
PurpleTerracotta,
BlueTerracotta,
BrownTerracotta,
GreenTerracotta,
RedTerracotta,
BlackTerracotta,
WhiteStainedGlassPane,
OrangeStainedGlassPane,
MagentaStainedGlassPane,
LightBlueStainedGlassPane,
YellowStainedGlassPane,
LimeStainedGlassPane,
PinkStainedGlassPane,
GrayStainedGlassPane,
LightGrayStainedGlassPane,
CyanStainedGlassPane,
PurpleStainedGlassPane,
BlueStainedGlassPane,
BrownStainedGlassPane,
GreenStainedGlassPane,
RedStainedGlassPane,
BlackStainedGlassPane,
AcaciaStairs,
DarkOakStairs,
SlimeBlock,
Barrier,
IronTrapdoor,
Prismarine,
PrismarineBricks,
DarkPrismarine,
PrismarineStairs,
PrismarineBrickStairs,
DarkPrismarineStairs,
PrismarineSlab,
PrismarineBrickSlab,
DarkPrismarineSlab,
SeaLantern,
HayBlock,
WhiteCarpet,
OrangeCarpet,
MagentaCarpet,
LightBlueCarpet,
YellowCarpet,
LimeCarpet,
PinkCarpet,
GrayCarpet,
LightGrayCarpet,
CyanCarpet,
PurpleCarpet,
BlueCarpet,
BrownCarpet,
GreenCarpet,
RedCarpet,
BlackCarpet,
Terracotta,
CoalBlock,
PackedIce,
Sunflower,
Lilac,
RoseBush,
Peony,
TallGrass,
LargeFern,
WhiteBanner,
OrangeBanner,
MagentaBanner,
LightBlueBanner,
YellowBanner,
LimeBanner,
PinkBanner,
GrayBanner,
LightGrayBanner,
CyanBanner,
PurpleBanner,
BlueBanner,
BrownBanner,
GreenBanner,
RedBanner,
BlackBanner,
WhiteWallBanner,
OrangeWallBanner,
MagentaWallBanner,
LightBlueWallBanner,
YellowWallBanner,
LimeWallBanner,
PinkWallBanner,
GrayWallBanner,
LightGrayWallBanner,
CyanWallBanner,
PurpleWallBanner,
BlueWallBanner,
BrownWallBanner,
GreenWallBanner,
RedWallBanner,
BlackWallBanner,
RedSandstone,
ChiseledRedSandstone,
CutRedSandstone,
RedSandstoneStairs,
OakSlab,
SpruceSlab,
BirchSlab,
JungleSlab,
AcaciaSlab,
DarkOakSlab,
StoneSlab,
SmoothStoneSlab,
SandstoneSlab,
CutSandstoneSlab,
PetrifiedOakSlab,
CobblestoneSlab,
BrickSlab,
StoneBrickSlab,
NetherBrickSlab,
QuartzSlab,
RedSandstoneSlab,
CutRedSandstoneSlab,
PurpurSlab,
SmoothStone,
SmoothSandstone,
SmoothQuartz,
SmoothRedSandstone,
SpruceFenceGate,
BirchFenceGate,
JungleFenceGate,
AcaciaFenceGate,
DarkOakFenceGate,
SpruceFence,
BirchFence,
JungleFence,
AcaciaFence,
DarkOakFence,
SpruceDoor,
BirchDoor,
JungleDoor,
AcaciaDoor,
DarkOakDoor,
EndRod,
ChorusPlant,
ChorusFlower,
PurpurBlock,
PurpurPillar,
PurpurStairs,
EndStoneBricks,
Beetroots,
GrassPath,
EndGateway,
RepeatingCommandBlock,
ChainCommandBlock,
FrostedIce,
MagmaBlock,
NetherWartBlock,
RedNetherBricks,
BoneBlock,
StructureVoid,
Observer,
ShulkerBox,
WhiteShulkerBox,
OrangeShulkerBox,
MagentaShulkerBox,
LightBlueShulkerBox,
YellowShulkerBox,
LimeShulkerBox,
PinkShulkerBox,
GrayShulkerBox,
LightGrayShulkerBox,
CyanShulkerBox,
PurpleShulkerBox,
BlueShulkerBox,
BrownShulkerBox,
GreenShulkerBox,
RedShulkerBox,
BlackShulkerBox,
WhiteGlazedTerracotta,
OrangeGlazedTerracotta,
MagentaGlazedTerracotta,
LightBlueGlazedTerracotta,
YellowGlazedTerracotta,
LimeGlazedTerracotta,
PinkGlazedTerracotta,
GrayGlazedTerracotta,
LightGrayGlazedTerracotta,
CyanGlazedTerracotta,
PurpleGlazedTerracotta,
BlueGlazedTerracotta,
BrownGlazedTerracotta,
GreenGlazedTerracotta,
RedGlazedTerracotta,
BlackGlazedTerracotta,
WhiteConcrete,
OrangeConcrete,
MagentaConcrete,
LightBlueConcrete,
YellowConcrete,
LimeConcrete,
PinkConcrete,
GrayConcrete,
LightGrayConcrete,
CyanConcrete,
PurpleConcrete,
BlueConcrete,
BrownConcrete,
GreenConcrete,
RedConcrete,
BlackConcrete,
WhiteConcretePowder,
OrangeConcretePowder,
MagentaConcretePowder,
LightBlueConcretePowder,
YellowConcretePowder,
LimeConcretePowder,
PinkConcretePowder,
GrayConcretePowder,
LightGrayConcretePowder,
CyanConcretePowder,
PurpleConcretePowder,
BlueConcretePowder,
BrownConcretePowder,
GreenConcretePowder,
RedConcretePowder,
BlackConcretePowder,
Kelp,
KelpPlant,
DriedKelpBlock,
TurtleEgg,
DeadTubeCoralBlock,
DeadBrainCoralBlock,
DeadBubbleCoralBlock,
DeadFireCoralBlock,
DeadHornCoralBlock,
TubeCoralBlock,
BrainCoralBlock,
BubbleCoralBlock,
FireCoralBlock,
HornCoralBlock,
DeadTubeCoral,
DeadBrainCoral,
DeadBubbleCoral,
DeadFireCoral,
DeadHornCoral,
TubeCoral,
BrainCoral,
BubbleCoral,
FireCoral,
HornCoral,
DeadTubeCoralFan,
DeadBrainCoralFan,
DeadBubbleCoralFan,
DeadFireCoralFan,
DeadHornCoralFan,
TubeCoralFan,
BrainCoralFan,
BubbleCoralFan,
FireCoralFan,
HornCoralFan,
DeadTubeCoralWallFan,
DeadBrainCoralWallFan,
DeadBubbleCoralWallFan,
DeadFireCoralWallFan,
DeadHornCoralWallFan,
TubeCoralWallFan,
BrainCoralWallFan,
BubbleCoralWallFan,
FireCoralWallFan,
HornCoralWallFan,
SeaPickle,
BlueIce,
Conduit,
BambooSapling,
Bamboo,
PottedBamboo,
VoidAir,
CaveAir,
BubbleColumn,
PolishedGraniteStairs,
SmoothRedSandstoneStairs,
MossyStoneBrickStairs,
PolishedDioriteStairs,
MossyCobblestoneStairs,
EndStoneBrickStairs,
StoneStairs,
SmoothSandstoneStairs,
SmoothQuartzStairs,
GraniteStairs,
AndesiteStairs,
RedNetherBrickStairs,
PolishedAndesiteStairs,
DioriteStairs,
PolishedGraniteSlab,
SmoothRedSandstoneSlab,
MossyStoneBrickSlab,
PolishedDioriteSlab,
MossyCobblestoneSlab,
EndStoneBrickSlab,
SmoothSandstoneSlab,
SmoothQuartzSlab,
GraniteSlab,
AndesiteSlab,
RedNetherBrickSlab,
PolishedAndesiteSlab,
DioriteSlab,
BrickWall,
PrismarineWall,
RedSandstoneWall,
MossyStoneBrickWall,
GraniteWall,
StoneBrickWall,
NetherBrickWall,
AndesiteWall,
RedNetherBrickWall,
SandstoneWall,
EndStoneBrickWall,
DioriteWall,
Scaffolding,
Loom,
Barrel,
Smoker,
BlastFurnace,
CartographyTable,
FletchingTable,
Grindstone,
Lectern,
SmithingTable,
Stonecutter,
Bell,
Lantern,
Campfire,
SweetBerryBush,
StructureBlock,
Jigsaw,
Composter,
BeeNest,
Beehive,
HoneyBlock,
HoneycombBlock,
}
}

View file

@ -514,6 +514,10 @@ namespace MinecraftClient.Mapping
case Material.StructureBlock: case Material.StructureBlock:
case Material.Jigsaw: case Material.Jigsaw:
case Material.Composter: case Material.Composter:
case Material.BeeNest:
case Material.Beehive:
case Material.HoneyBlock:
case Material.HoneycombBlock:
return true; return true;
default: default:
return false; return false;

View file

@ -100,6 +100,7 @@
<Compile Include="Mapping\BlockPalettes\Palette112.cs" /> <Compile Include="Mapping\BlockPalettes\Palette112.cs" />
<Compile Include="Mapping\BlockPalettes\Palette113.cs" /> <Compile Include="Mapping\BlockPalettes\Palette113.cs" />
<Compile Include="Mapping\BlockPalettes\Palette114.cs" /> <Compile Include="Mapping\BlockPalettes\Palette114.cs" />
<Compile Include="Mapping\BlockPalettes\Palette115.cs" />
<Compile Include="Mapping\BlockPalettes\PaletteGenerator.cs" /> <Compile Include="Mapping\BlockPalettes\PaletteGenerator.cs" />
<Compile Include="Mapping\BlockPalettes\PaletteMapping.cs" /> <Compile Include="Mapping\BlockPalettes\PaletteMapping.cs" />
<Compile Include="Mapping\MaterialExtensions.cs" /> <Compile Include="Mapping\MaterialExtensions.cs" />

View file

@ -30,7 +30,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.14.4"; public const string MCHighestVersion = "1.15.0";
public static readonly string BuildInfo = null; public static readonly string BuildInfo = null;
private static Thread offlinePrompt = null; private static Thread offlinePrompt = null;

View file

@ -35,6 +35,7 @@ namespace MinecraftClient.Protocol.Handlers
internal const int MC113Version = 393; internal const int MC113Version = 393;
internal const int MC114Version = 477; internal const int MC114Version = 477;
internal const int MC1144Version = 498; internal const int MC1144Version = 498;
internal const int MC115Version = 573;
private int compression_treshold = 0; private int compression_treshold = 0;
private bool autocomplete_received = false; private bool autocomplete_received = false;
@ -62,7 +63,7 @@ namespace MinecraftClient.Protocol.Handlers
this.pForge = new Protocol18Forge(forgeInfo, protocolVersion, dataTypes, this, handler); this.pForge = new Protocol18Forge(forgeInfo, protocolVersion, dataTypes, this, handler);
this.pTerrain = new Protocol18Terrain(protocolVersion, dataTypes, handler); this.pTerrain = new Protocol18Terrain(protocolVersion, dataTypes, handler);
if (handler.GetTerrainEnabled() && protocolversion > MC1144Version) if (handler.GetTerrainEnabled() && protocolversion > MC115Version)
{ {
ConsoleIO.WriteLineFormatted("§8Terrain & Movements currently not handled for that MC version."); ConsoleIO.WriteLineFormatted("§8Terrain & Movements currently not handled for that MC version.");
handler.SetTerrainEnabled(false); handler.SetTerrainEnabled(false);
@ -76,9 +77,11 @@ namespace MinecraftClient.Protocol.Handlers
if (protocolversion >= MC113Version) if (protocolversion >= MC113Version)
{ {
if (protocolVersion > MC1144Version && handler.GetTerrainEnabled()) if (protocolVersion > MC115Version && handler.GetTerrainEnabled())
throw new NotImplementedException("Please update block types handling for this Minecraft version. See Material.cs"); throw new NotImplementedException("Please update block types handling for this Minecraft version. See Material.cs");
if (protocolVersion >= MC114Version) if (protocolVersion >= MC115Version)
Block.Palette = new Palette115();
else if (protocolVersion >= MC114Version)
Block.Palette = new Palette114(); Block.Palette = new Palette114();
else Block.Palette = new Palette113(); else Block.Palette = new Palette113();
} }
@ -197,12 +200,16 @@ namespace MinecraftClient.Protocol.Handlers
this.currentDimension = (sbyte)dataTypes.ReadNextByte(packetData); this.currentDimension = (sbyte)dataTypes.ReadNextByte(packetData);
if (protocolversion < MC114Version) if (protocolversion < MC114Version)
dataTypes.ReadNextByte(packetData); // Difficulty - 1.13 and below dataTypes.ReadNextByte(packetData); // Difficulty - 1.13 and below
if (protocolversion >= MC115Version)
dataTypes.ReadNextLong(packetData); // Hashed world seed - 1.15 and above
dataTypes.ReadNextByte(packetData); dataTypes.ReadNextByte(packetData);
dataTypes.ReadNextString(packetData); dataTypes.ReadNextString(packetData);
if (protocolversion >= MC114Version) if (protocolversion >= MC114Version)
dataTypes.ReadNextVarInt(packetData); // View distance - 1.14 and above dataTypes.ReadNextVarInt(packetData); // View distance - 1.14 and above
if (protocolversion >= MC18Version) if (protocolversion >= MC18Version)
dataTypes.ReadNextBool(packetData); // Reduced debug info - 1.8 and above dataTypes.ReadNextBool(packetData); // Reduced debug info - 1.8 and above
if (protocolversion >= MC115Version)
dataTypes.ReadNextBool(packetData); // Enable respawn screen - 1.15 and above
break; break;
case PacketIncomingType.ChatMessage: case PacketIncomingType.ChatMessage:
string message = dataTypes.ReadNextString(packetData); string message = dataTypes.ReadNextString(packetData);
@ -221,6 +228,8 @@ namespace MinecraftClient.Protocol.Handlers
this.currentDimension = dataTypes.ReadNextInt(packetData); this.currentDimension = dataTypes.ReadNextInt(packetData);
if (protocolversion < MC114Version) if (protocolversion < MC114Version)
dataTypes.ReadNextByte(packetData); // Difficulty - 1.13 and below dataTypes.ReadNextByte(packetData); // Difficulty - 1.13 and below
if (protocolversion >= MC115Version)
dataTypes.ReadNextLong(packetData); // Hashed world seed - 1.15 and above
dataTypes.ReadNextByte(packetData); dataTypes.ReadNextByte(packetData);
dataTypes.ReadNextString(packetData); dataTypes.ReadNextString(packetData);
handler.OnRespawn(); handler.OnRespawn();
@ -275,6 +284,8 @@ namespace MinecraftClient.Protocol.Handlers
{ {
if (protocolversion >= MC114Version) if (protocolversion >= MC114Version)
dataTypes.ReadNextNbt(packetData); // Heightmaps - 1.14 and above dataTypes.ReadNextNbt(packetData); // Heightmaps - 1.14 and above
if (protocolversion >= MC115Version && chunksContinuous)
dataTypes.ReadData(1024 * 4, packetData); // Biomes - 1.15 and above
int dataSize = dataTypes.ReadNextVarInt(packetData); int dataSize = dataTypes.ReadNextVarInt(packetData);
pTerrain.ProcessChunkColumnData(chunkX, chunkZ, chunkMask, 0, false, chunksContinuous, currentDimension, packetData); pTerrain.ProcessChunkColumnData(chunkX, chunkZ, chunkMask, 0, false, chunksContinuous, currentDimension, packetData);
} }

View file

@ -147,7 +147,7 @@ namespace MinecraftClient.Protocol.Handlers
default: return PacketIncomingType.UnknownPacket; default: return PacketIncomingType.UnknownPacket;
} }
} }
else // MC 1.14 else if (protocol < Protocol18Handler.MC115Version) // MC 1.14 to 1.14.4
{ {
switch (packetID) switch (packetID)
{ {
@ -172,6 +172,31 @@ namespace MinecraftClient.Protocol.Handlers
default: return PacketIncomingType.UnknownPacket; default: return PacketIncomingType.UnknownPacket;
} }
} }
else // MC 1.15
{
switch (packetID)
{
case 0x21: return PacketIncomingType.KeepAlive;
case 0x26: return PacketIncomingType.JoinGame;
case 0x0F: return PacketIncomingType.ChatMessage;
case 0x3B: return PacketIncomingType.Respawn;
case 0x36: return PacketIncomingType.PlayerPositionAndLook;
case 0x22: return PacketIncomingType.ChunkData;
case 0x10: return PacketIncomingType.MultiBlockChange;
case 0x0C: return PacketIncomingType.BlockChange;
case 0x1E: return PacketIncomingType.UnloadChunk;
case 0x34: return PacketIncomingType.PlayerListUpdate;
case 0x11: return PacketIncomingType.TabCompleteResult;
case 0x19: return PacketIncomingType.PluginMessage;
case 0x1B: return PacketIncomingType.KickPacket;
case 0x3A: return PacketIncomingType.ResourcePackSend;
case 0x2F: return PacketIncomingType.OpenWindow;
case 0x14: return PacketIncomingType.CloseWindow;
case 0x15: return PacketIncomingType.WindowItems;
case 0x17: return PacketIncomingType.SetSlot;
default: return PacketIncomingType.UnknownPacket;
}
}
} }
/// <summary> /// <summary>
@ -262,7 +287,7 @@ namespace MinecraftClient.Protocol.Handlers
case PacketOutgoingType.TeleportConfirm: return 0x00; case PacketOutgoingType.TeleportConfirm: return 0x00;
} }
} }
else // MC 1.14 else // MC 1.14 to 1.15
{ {
switch (packet) switch (packet)
{ {

View file

@ -111,7 +111,7 @@ namespace MinecraftClient.Protocol
int[] supportedVersions_Protocol16 = { 51, 60, 61, 72, 73, 74, 78 }; int[] supportedVersions_Protocol16 = { 51, 60, 61, 72, 73, 74, 78 };
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 }; 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 };
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);
throw new NotSupportedException("The protocol version no." + ProtocolVersion + " is not supported."); throw new NotSupportedException("The protocol version no." + ProtocolVersion + " is not supported.");
@ -211,6 +211,9 @@ namespace MinecraftClient.Protocol
return 490; return 490;
case "1.14.4": case "1.14.4":
return 498; return 498;
case "1.15":
case "1.15.0":
return 573;
default: default:
return 0; return 0;
} }