Partialy fixed interaction with Armor Stand

This commit is contained in:
Anon 2023-03-30 21:06:54 +02:00
parent bbb3b1e38a
commit db6422d154
2 changed files with 22 additions and 8 deletions

View file

@ -314,7 +314,11 @@ namespace MinecraftClient.Commands
handler.InteractEntity(entity.ID, InteractType.Attack);
return Translations.cmd_entityCmd_attacked;
case ActionType.Use:
handler.InteractEntity(entity.ID, InteractType.Interact);
bool shouldInteractAt = entity.Type == EntityType.ArmorStand ||
entity.Type == EntityType.ChestMinecart ||
entity.Type == EntityType.ChestBoat;
handler.InteractEntity(entity.ID, shouldInteractAt ? InteractType.InteractAt : InteractType.Interact);
return Translations.cmd_entityCmd_used;
case ActionType.List:
return GetEntityInfoDetailed(handler, entity);

View file

@ -2195,16 +2195,26 @@ namespace MinecraftClient
if (entities.ContainsKey(entityID))
{
if (type == InteractType.Interact)
switch (type)
{
case InteractType.Interact:
return handler.SendInteractEntity(entityID, (int)type, (int)hand);
}
else
{
case InteractType.InteractAt:
return handler.SendInteractEntity(
EntityID: entityID,
type: (int)type,
X: (float)entities[entityID].Location.X,
Y: (float)entities[entityID].Location.Y,
Z: (float)entities[entityID].Location.Z,
hand: (int)hand);
default:
return handler.SendInteractEntity(entityID, (int)type);
}
}
else return false;
return false;
}
/// <summary>