mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix entity handling crash (#1241)
Fix #1237 * Fix crash * Update Entity.cs * Update Entitycmd.cs * Update McClient.cs
This commit is contained in:
parent
2649e61a88
commit
02e294e3e8
3 changed files with 7 additions and 8 deletions
|
|
@ -2180,14 +2180,10 @@ namespace MinecraftClient
|
|||
entity.Metadata = metadata;
|
||||
if (entity.Type.ContainsItem() && metadata.ContainsKey(7) && metadata[7] != null && metadata[7].GetType() == typeof(Item))
|
||||
{
|
||||
try
|
||||
{
|
||||
entity.Item = (Item)metadata[7];
|
||||
}
|
||||
catch
|
||||
{
|
||||
Item item = (Item)metadata[7];
|
||||
if (item == null)
|
||||
entity.Item = new Item(ItemType.Air, 0, null);
|
||||
}
|
||||
else entity.Item = item;
|
||||
}
|
||||
if (metadata.ContainsKey(6) && metadata[6] != null && metadata[6].GetType() == typeof(Int32))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue