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
|
|
@ -144,10 +144,11 @@ namespace MinecraftClient.Commands
|
|||
string customname = entity2.Value.CustomName;
|
||||
EntityPose pose = entity2.Value.Pose;
|
||||
EntityType type = entity2.Value.Type;
|
||||
Item item = entity2.Value.Item;
|
||||
string location = String.Format("X:{0}, Y:{1}, Z:{2}", Math.Round(entity2.Value.Location.X, 2), Math.Round(entity2.Value.Location.Y, 2), Math.Round(entity2.Value.Location.Y, 2));
|
||||
|
||||
if (type == EntityType.Item || type == EntityType.ItemFrame || type == Mapping.EntityType.EyeOfEnder || type == Mapping.EntityType.Egg || type == Mapping.EntityType.EnderPearl || type == Mapping.EntityType.Potion || type == Mapping.EntityType.Fireball || type == Mapping.EntityType.FireworkRocket)
|
||||
response.Add(String.Format(" #{0}: Type: {1}, Item: {2}, Location: {3}", id, type, entity2.Value.Item.Type, location));
|
||||
response.Add(String.Format(" #{0}: Type: {1}, Item: {2}, Location: {3}", id, type, item.Type, location));
|
||||
else if (type == Mapping.EntityType.Player && !String.IsNullOrEmpty(nickname))
|
||||
response.Add(String.Format(" #{0}: Type: {1}, Nickname: §8{2}§8, Latency: {3}, Health: {4}, Pose: {5}, Location: {6}", id, type, nickname, latency, health, pose, location));
|
||||
else if (type == Mapping.EntityType.Player && !String.IsNullOrEmpty(customname))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue