mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add entity handling for 1.10 to 1.12.2 (#1195)
* Fix entity type data type for 1.13 below * Add entity handling for 1.10 to 1.12.2 * Update comments for EntityPalette113
This commit is contained in:
parent
a28409043c
commit
e6d34c3cf1
5 changed files with 163 additions and 8 deletions
|
|
@ -370,7 +370,17 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
entityUUID = ReadNextUUID(cache);
|
||||
}
|
||||
|
||||
EntityType entityType = entityPalette.FromId(ReadNextVarInt(cache), living);
|
||||
EntityType entityType;
|
||||
// Entity type data type change from byte to varint after 1.14
|
||||
if (protocolversion > Protocol18Handler.MC113Version)
|
||||
{
|
||||
entityType = entityPalette.FromId(ReadNextVarInt(cache), living);
|
||||
}
|
||||
else
|
||||
{
|
||||
entityType = entityPalette.FromId(ReadNextByte(cache), living);
|
||||
}
|
||||
|
||||
Double entityX = ReadNextDouble(cache);
|
||||
Double entityY = ReadNextDouble(cache);
|
||||
Double entityZ = ReadNextDouble(cache);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
handler.SetInventoryEnabled(false);
|
||||
}
|
||||
|
||||
if (handler.GetEntityHandlingEnabled() && (protocolversion <= MC1122Version || protocolversion > MC1161Version))
|
||||
if (handler.GetEntityHandlingEnabled() && (protocolversion < MC110Version || protocolversion > MC1161Version))
|
||||
{
|
||||
ConsoleIO.WriteLineFormatted("§8Entities are currently not handled for that MC version.");
|
||||
handler.SetEntityHandlingEnabled(false);
|
||||
|
|
@ -102,7 +102,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
}
|
||||
else Block.Palette = new Palette112();
|
||||
|
||||
if (protocolversion >= MC114Version)
|
||||
if (protocolversion >= MC113Version)
|
||||
{
|
||||
if (protocolversion > MC1161Version && handler.GetEntityHandlingEnabled())
|
||||
throw new NotImplementedException("Please update entity types handling for this Minecraft version. See EntityType.cs");
|
||||
|
|
@ -110,9 +110,11 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
entityPalette = new EntityPalette116();
|
||||
else if (protocolversion >= MC115Version)
|
||||
entityPalette = new EntityPalette115();
|
||||
else entityPalette = new EntityPalette114();
|
||||
else if (protocolVersion >= MC114Version)
|
||||
entityPalette = new EntityPalette114();
|
||||
else entityPalette = new EntityPalette113();
|
||||
}
|
||||
else entityPalette = new EntityPalette113();
|
||||
else entityPalette = new EntityPalette112();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue