mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
tmp commit
This commit is contained in:
parent
a51368a859
commit
82fb081828
3 changed files with 74 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using MinecraftClient.Inventory;
|
||||
using MinecraftClient.Mapping;
|
||||
|
||||
namespace MinecraftClient.ChatBots
|
||||
{
|
||||
|
|
@ -11,9 +12,45 @@ namespace MinecraftClient.ChatBots
|
|||
private bool waitingForResult = false;
|
||||
private int inventoryInUse;
|
||||
|
||||
private enum ActionType
|
||||
{
|
||||
MoveTo,
|
||||
WaitForUpdate,
|
||||
Repeat
|
||||
}
|
||||
|
||||
private class ActionStep
|
||||
{
|
||||
public ActionType Action;
|
||||
public int Slot;
|
||||
public int InventoryID;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
RegisterChatBotCommand("craft", "craft", CraftCommand);
|
||||
RegisterChatBotCommand("open", "open", Open);
|
||||
RegisterChatBotCommand("place", "place", Place);
|
||||
}
|
||||
|
||||
public string Open(string command, string[] args)
|
||||
{
|
||||
double x = -258;
|
||||
double y = 64;
|
||||
double z = -187;
|
||||
Location l = new Location(x, y, z);
|
||||
SendPlaceBlock(l, Direction.Up);
|
||||
SendAnimation();
|
||||
return "Try to open";
|
||||
}
|
||||
|
||||
public string Place(string command, string[] args)
|
||||
{
|
||||
double x = Convert.ToDouble(args[0]);
|
||||
double y = Convert.ToDouble(args[1]);
|
||||
double z = Convert.ToDouble(args[2]);
|
||||
SendPlaceBlock(new Location(x, y, z), Direction.Down);
|
||||
return "Try place";
|
||||
}
|
||||
|
||||
public string CraftCommand(string command, string[] args)
|
||||
|
|
@ -29,6 +66,7 @@ namespace MinecraftClient.ChatBots
|
|||
foreach (KeyValuePair<int, ItemType> slot in recipe)
|
||||
{
|
||||
slotToPut = slot.Key + 1;
|
||||
slotToTake = -2;
|
||||
// Find material in our inventory
|
||||
foreach (KeyValuePair<int, Item> item in inventory.Items)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue