app tweaks
This commit is contained in:
@@ -16,6 +16,8 @@ if not turtle.select('minecraft:bucket') then
|
|||||||
end
|
end
|
||||||
|
|
||||||
local s, m = turtle.run(function()
|
local s, m = turtle.run(function()
|
||||||
|
turtle.setMovementStrategy('goto')
|
||||||
|
|
||||||
local facing = scanner.getBlockMeta(0, 0, 0).state.facing
|
local facing = scanner.getBlockMeta(0, 0, 0).state.facing
|
||||||
turtle.setPoint({ x = 0, y = 0, z = 0, heading = Point.facings[facing].heading })
|
turtle.setPoint({ x = 0, y = 0, z = 0, heading = Point.facings[facing].heading })
|
||||||
|
|
||||||
@@ -9,7 +9,14 @@ local device = _G.device
|
|||||||
local os = _G.os
|
local os = _G.os
|
||||||
local turtle = _G.turtle
|
local turtle = _G.turtle
|
||||||
|
|
||||||
|
local retain = Util.transpose {
|
||||||
|
'minecraft:shears',
|
||||||
|
'minecraft_wheat',
|
||||||
|
'minecraft:diamond_sword',
|
||||||
|
'plethora:module:3',
|
||||||
|
}
|
||||||
local config = {
|
local config = {
|
||||||
|
animal = 'Cow',
|
||||||
max_cows = 15,
|
max_cows = 15,
|
||||||
}
|
}
|
||||||
Config.load('cows', config)
|
Config.load('cows', config)
|
||||||
@@ -51,7 +58,7 @@ local function getCowCount()
|
|||||||
local xpCount = 0
|
local xpCount = 0
|
||||||
|
|
||||||
Util.filterInplace(blocks, function(v)
|
Util.filterInplace(blocks, function(v)
|
||||||
if v.name == 'Cow' then
|
if v.name == config.animal then
|
||||||
if v.y > -.5 then grown = grown + 1 end
|
if v.y > -.5 then grown = grown + 1 end
|
||||||
if v.y < -.5 then babies = babies + 1 end
|
if v.y < -.5 then babies = babies + 1 end
|
||||||
return v.y > -.5
|
return v.y > -.5
|
||||||
@@ -76,16 +83,26 @@ local function butcher()
|
|||||||
end
|
end
|
||||||
turtle.equip('right', 'plethora:module:3')
|
turtle.equip('right', 'plethora:module:3')
|
||||||
|
|
||||||
turtle.dropUp('minecraft:beef')
|
turtle.eachFilledSlot(function(slot)
|
||||||
turtle.dropUp('minecraft:leather')
|
if not retain[slot.name] then
|
||||||
|
turtle.select(slot.index)
|
||||||
|
turtle.dropUp()
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function breed()
|
local function breed()
|
||||||
turtle.select(1)
|
turtle.select(1)
|
||||||
|
|
||||||
|
if config.animal == 'Sheep' then
|
||||||
|
turtle.place('minecraft:shears')
|
||||||
|
end
|
||||||
turtle.place('minecraft:wheat')
|
turtle.place('minecraft:wheat')
|
||||||
for _ = 1, 3 do
|
for _ = 1, 3 do
|
||||||
turtle.turnRight()
|
turtle.turnRight()
|
||||||
|
if config.animal == 'Sheep' then
|
||||||
|
turtle.place('minecraft:shears')
|
||||||
|
end
|
||||||
turtle.place('minecraft:wheat')
|
turtle.place('minecraft:wheat')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user