diff --git a/config.lua b/config.lua index 9df2c40..1d9c557 100644 --- a/config.lua +++ b/config.lua @@ -256,7 +256,6 @@ description = "A radon Shop", owner = nil, location = { - coordinates = nil, description = nil, dimension = "overworld" } diff --git a/configDefaults.lua b/configDefaults.lua index 8313c83..4606ede 100644 --- a/configDefaults.lua +++ b/configDefaults.lua @@ -184,7 +184,6 @@ description = "A radon Shop", owner = nil, location = { - coordinates = nil, description = nil, dimension = "overworld" } diff --git a/core/ShopState.lua b/core/ShopState.lua index c608a5e..d00d3c0 100644 --- a/core/ShopState.lua +++ b/core/ShopState.lua @@ -425,9 +425,13 @@ sleep(blinkFrequency) end end, function() + local x, y, z while self.running do sleep(shopSyncFrequency) if self.config.shopSync and self.config.shopSync.enabled and self.peripherals.shopSyncModem then + if not x or not y or not z then + x, y, z = gps.locate(5) + end local items = {} for i = 1, #self.products do local product = self.products[i] @@ -482,7 +486,11 @@ name = "Radon", version = self.version }, - location = self.config.shopSync.location, + location = { + coordinates = {x, y, z}, + description = self.config.shopSync.location.description, + dimension = self.config.shopSync.location.dimension + }, }, items = items }) diff --git a/core/schemas.lua b/core/schemas.lua index ab92f1a..5a44e1e 100644 --- a/core/schemas.lua +++ b/core/schemas.lua @@ -197,12 +197,6 @@ description = "string?", owner = "string?", location = { - coordinates = { - __type = "array?", - __min = 3, - __max = 3, - __entry = "number" - }, description = "string?", dimension = "enum<'overworld' | 'nether' | 'end'>?: dimension" }