AuotoAttack: add support for multiple interact modes (#2044)

* Adds support for multiple interact modes
* Entity interaction: Implement enum

Co-authored-by: ORelio <ORelio@users.noreply.github.com>
This commit is contained in:
Booquefius 2022-08-15 17:31:17 -04:00 committed by GitHub
parent fd7f79402f
commit 613f52d3ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 116 additions and 80 deletions

View file

@ -33,10 +33,10 @@ namespace MinecraftClient.Commands
switch (action)
{
case "attack":
handler.InteractEntity(entityID, 1);
handler.InteractEntity(entityID, InteractType.Attack);
return Translations.Get("cmd.entityCmd.attacked");
case "use":
handler.InteractEntity(entityID, 0);
handler.InteractEntity(entityID, InteractType.Interact);
return Translations.Get("cmd.entityCmd.used");
default:
Entity entity = handler.GetEntities()[entityID];
@ -113,13 +113,13 @@ namespace MinecraftClient.Commands
: "list";
if (action == "attack")
{
handler.InteractEntity(entity2.Key, 1);
handler.InteractEntity(entity2.Key, InteractType.Attack);
actionst = "cmd.entityCmd.attacked";
actioncount++;
}
else if (action == "use")
{
handler.InteractEntity(entity2.Key, 0);
handler.InteractEntity(entity2.Key, InteractType.Interact);
actionst = "cmd.entityCmd.used";
actioncount++;
}