Added host side command for quarrying.

This commit is contained in:
2021-05-07 17:10:41 -05:00
parent ced8bc2b50
commit 25f5c4a62b
2 changed files with 12 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ local MOVETO = "moveto"
local STATUS = "status"
local POSITION = "position"
local HEADING = "heading"
local QUARRYCHUNK = "quarry"
local QUARRY = "quarry"
local TASK = "task"
local FAILED = "failed"
-- Constant messaging
@@ -421,8 +421,10 @@ local function quarry(x, y, z, forward, right, pattern)
end
if (y > 0) then
attemptMoveUp();
elseif (y < 0) then
attemptMoveDown();
else
if not attemptMoveDown() then
sendLog(FAILED, "Unable to move further down for quarrying.")
end
end
end
end
@@ -515,7 +517,9 @@ local function listen()
elseif data["request"] == QUARRY then
if heading ~= nil then
quarry(data["content"][1], data["content"][2], data["content"][3], heading, rightAxis)
sendLog(QUARRY, "Using actual position for quarrying.")
else
sendLog(QUARRY, "Using relative position for quarrying.")
quarry(data["content"][1], data["content"][2], data["content"][3], relHeading, relRightAxis)
end
end