diff --git a/sys/apis/sound.lua b/sys/apis/sound.lua index b4dab46..18dad1c 100644 --- a/sys/apis/sound.lua +++ b/sys/apis/sound.lua @@ -5,10 +5,9 @@ local Sound = { } function Sound.play(sound, vol) - local speaker = peripheral.find('speaker') - if speaker then - speaker.playSound('minecraft:' .. sound, vol or Sound._volume) - end + peripheral.find('speaker', function(_, s) + s.playSound('minecraft:' .. sound, vol or Sound._volume) + end) end function Sound.setVolume(volume) diff --git a/sys/apis/ui.lua b/sys/apis/ui.lua index 068b7d9..dcc0ae8 100644 --- a/sys/apis/ui.lua +++ b/sys/apis/ui.lua @@ -46,7 +46,7 @@ end local Manager = class() function Manager:init() self.devices = { } -_G._pp = self + local function keyFunction(event, code, held) local ie = Input:translate(event, code, held)