diff --git a/milo/apps/water.lua b/milo/apps/water.lua index eb8a79f..fb3ec5f 100644 --- a/milo/apps/water.lua +++ b/milo/apps/water.lua @@ -1,3 +1,4 @@ +local Sound = require('sound') local Util = require('util') local fs = _G.fs @@ -11,12 +12,27 @@ if not fs.exists(STARTUP_FILE) then shell.openForegroundTab('packages/milo/apps/water')]]) end +local played = false + +local function play(sound) + if not played then + --played = true + Sound.play(sound) + end +end + while true do - turtle.placeDown('minecraft:bucket:0') - turtle.placeDown('minecraft:glass_bottle:0') + if turtle.placeDown('minecraft:bucket:0') then + play('item.bucket.fill') + end + if turtle.placeDown('minecraft:glass_bottle:0') then + play('item.bottle.fill') + end + for k,v in pairs(turtle.getInventory()) do if v.name == 'minecraft:concrete_powder' or v.name == 'minecraft:gravel' then turtle.select(k) + play('block.gravel.break') for _ = 1, v.count do turtle.placeDown() turtle.digDown() @@ -24,4 +40,5 @@ while true do end end os.pullEvent('turtle_inventory') + played = false end