mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
parent
52d98538b3
commit
c6f00ce686
9 changed files with 1863 additions and 7 deletions
|
|
@ -35,6 +35,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
internal const int MC113Version = 393;
|
||||
internal const int MC114Version = 477;
|
||||
internal const int MC1144Version = 498;
|
||||
internal const int MC115Version = 573;
|
||||
|
||||
private int compression_treshold = 0;
|
||||
private bool autocomplete_received = false;
|
||||
|
|
@ -62,7 +63,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
this.pForge = new Protocol18Forge(forgeInfo, protocolVersion, dataTypes, this, 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.");
|
||||
handler.SetTerrainEnabled(false);
|
||||
|
|
@ -76,9 +77,11 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
|
||||
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");
|
||||
if (protocolVersion >= MC114Version)
|
||||
if (protocolVersion >= MC115Version)
|
||||
Block.Palette = new Palette115();
|
||||
else if (protocolVersion >= MC114Version)
|
||||
Block.Palette = new Palette114();
|
||||
else Block.Palette = new Palette113();
|
||||
}
|
||||
|
|
@ -197,12 +200,16 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
this.currentDimension = (sbyte)dataTypes.ReadNextByte(packetData);
|
||||
if (protocolversion < MC114Version)
|
||||
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.ReadNextString(packetData);
|
||||
if (protocolversion >= MC114Version)
|
||||
dataTypes.ReadNextVarInt(packetData); // View distance - 1.14 and above
|
||||
if (protocolversion >= MC18Version)
|
||||
dataTypes.ReadNextBool(packetData); // Reduced debug info - 1.8 and above
|
||||
if (protocolversion >= MC115Version)
|
||||
dataTypes.ReadNextBool(packetData); // Enable respawn screen - 1.15 and above
|
||||
break;
|
||||
case PacketIncomingType.ChatMessage:
|
||||
string message = dataTypes.ReadNextString(packetData);
|
||||
|
|
@ -221,6 +228,8 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
this.currentDimension = dataTypes.ReadNextInt(packetData);
|
||||
if (protocolversion < MC114Version)
|
||||
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.ReadNextString(packetData);
|
||||
handler.OnRespawn();
|
||||
|
|
@ -275,6 +284,8 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
{
|
||||
if (protocolversion >= MC114Version)
|
||||
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);
|
||||
pTerrain.ProcessChunkColumnData(chunkX, chunkZ, chunkMask, 0, false, chunksContinuous, currentDimension, packetData);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
default: return PacketIncomingType.UnknownPacket;
|
||||
}
|
||||
}
|
||||
else // MC 1.14
|
||||
else if (protocol < Protocol18Handler.MC115Version) // MC 1.14 to 1.14.4
|
||||
{
|
||||
switch (packetID)
|
||||
{
|
||||
|
|
@ -172,6 +172,31 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
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>
|
||||
|
|
@ -262,7 +287,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
case PacketOutgoingType.TeleportConfirm: return 0x00;
|
||||
}
|
||||
}
|
||||
else // MC 1.14
|
||||
else // MC 1.14 to 1.15
|
||||
{
|
||||
switch (packet)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue