remove rancher dispenser requirement
This commit is contained in:
@@ -25,10 +25,8 @@ local sensor = device['plethora:sensor'] or
|
|||||||
turtle.equip('right', 'plethora:module:3') and device['plethora:sensor'] or
|
turtle.equip('right', 'plethora:module:3') and device['plethora:sensor'] or
|
||||||
error('Plethora sensor required')
|
error('Plethora sensor required')
|
||||||
|
|
||||||
local dispenser = Peripheral.lookup('type/minecraft:dispenser') or
|
local dispenser = Peripheral.lookup('type/minecraft:dispenser')
|
||||||
error('Dispenser not found')
|
local integrator = Peripheral.lookup('type/redstone_integrator')
|
||||||
local integrator = Peripheral.lookup('type/redstone_integrator') or
|
|
||||||
error('Integrator not found')
|
|
||||||
|
|
||||||
local function pulse()
|
local function pulse()
|
||||||
integrator.setOutput('north', true)
|
integrator.setOutput('north', true)
|
||||||
@@ -37,16 +35,20 @@ local function pulse()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function turnOffWater()
|
local function turnOffWater()
|
||||||
local list = dispenser.list()
|
if dispenser then
|
||||||
if list[1].name == 'minecraft:bucket' then
|
local list = dispenser.list()
|
||||||
pulse()
|
if list[1].name == 'minecraft:bucket' then
|
||||||
os.sleep(2)
|
pulse()
|
||||||
|
os.sleep(2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function turnOnWater()
|
local function turnOnWater()
|
||||||
if dispenser.list()[1].name == 'minecraft:water_bucket' then
|
if dispenser then
|
||||||
pulse()
|
if dispenser.list()[1].name == 'minecraft:water_bucket' then
|
||||||
|
pulse()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user