MC 1.14 Terrain support (#703)

Minecraft 1.14 is now fully supported.

- Implement NBT parsing to skip NBT field in chunk data
- Update lighting data format in Chunk Data parsing
- Move Chunk Data parsing into Protocol18Terrain.cs
- Improve PaletteGenerator to greatly reduce palette files sizes
- Re-Generate Palette113.cs to reduce its size (378 Kib -> 50 Kib)
- Generate Palette114.cs (57 Kib instead of 516 Kib with prev format)
- Update Material.cs and MaterialExtensions.cs for new block types
This commit is contained in:
ORelio 2019-05-01 15:23:30 +02:00
parent d2cbc9f1c3
commit 0d58fb9063
11 changed files with 2703 additions and 8900 deletions

View file

@ -234,7 +234,7 @@ namespace MinecraftClient.Protocol.Handlers
}
/// <summary>
/// Send a forge plugin channel packet ("FML|HS"). Compression and encryption will be handled automatically
/// Send a forge plugin channel packet ("FML|HS"). Compression and encryption will be handled automatically.
/// </summary>
/// <param name="discriminator">Discriminator to use.</param>
/// <param name="data">packet Data</param>
@ -242,5 +242,36 @@ namespace MinecraftClient.Protocol.Handlers
{
protocol18.SendPluginChannelPacket("FML|HS", dataTypes.ConcatBytes(new byte[] { (byte)discriminator }, data));
}
/// <summary>
/// Server Info: Check for For Forge on a Minecraft server Ping result
/// </summary>
/// <param name="jsonData">JSON data returned by the server</param>
/// <param name="forgeInfo">ForgeInfo to populate</param>
public static void ServerInfoCheckForge(Json.JSONData jsonData, ref ForgeInfo forgeInfo)
{
if (jsonData.Properties.ContainsKey("modinfo") && jsonData.Properties["modinfo"].Type == Json.JSONData.DataType.Object)
{
Json.JSONData modData = jsonData.Properties["modinfo"];
if (modData.Properties.ContainsKey("type") && modData.Properties["type"].StringValue == "FML")
{
forgeInfo = new ForgeInfo(modData);
if (forgeInfo.Mods.Any())
{
if (Settings.DebugMessages)
{
ConsoleIO.WriteLineFormatted("§8Server is running Forge. Mod list:");
foreach (ForgeInfo.ForgeMod mod in forgeInfo.Mods)
{
ConsoleIO.WriteLineFormatted("§8 " + mod.ToString());
}
}
else ConsoleIO.WriteLineFormatted("§8Server is running Forge.");
}
else forgeInfo = null;
}
}
}
}
}