diff --git a/res/content/base/block_materials/snow.json b/res/content/base/block_materials/snow.json new file mode 100644 index 00000000..42359b2e --- /dev/null +++ b/res/content/base/block_materials/snow.json @@ -0,0 +1,5 @@ +{ + "steps-sound": "steps/snow", + "place-sound": "blocks/snow_place", + "break-sound": "blocks/snow_break" +} diff --git a/res/content/base/sounds/blocks/snow_3.ogg b/res/content/base/sounds/blocks/snow_3.ogg new file mode 100644 index 00000000..72af9661 Binary files /dev/null and b/res/content/base/sounds/blocks/snow_3.ogg differ diff --git a/res/content/base/sounds/blocks/snow_break.ogg b/res/content/base/sounds/blocks/snow_break.ogg new file mode 100644 index 00000000..8f2df1a8 Binary files /dev/null and b/res/content/base/sounds/blocks/snow_break.ogg differ diff --git a/res/content/base/sounds/blocks/snow_place.ogg b/res/content/base/sounds/blocks/snow_place.ogg new file mode 100644 index 00000000..9595ba20 Binary files /dev/null and b/res/content/base/sounds/blocks/snow_place.ogg differ diff --git a/res/content/base/sounds/blocks/wood_break.ogg b/res/content/base/sounds/blocks/wood_break.ogg index d0fa78cc..e6c9a47f 100644 Binary files a/res/content/base/sounds/blocks/wood_break.ogg and b/res/content/base/sounds/blocks/wood_break.ogg differ diff --git a/res/content/base/sounds/blocks/wood_place.ogg b/res/content/base/sounds/blocks/wood_place.ogg index fea80562..6fbeee5e 100644 Binary files a/res/content/base/sounds/blocks/wood_place.ogg and b/res/content/base/sounds/blocks/wood_place.ogg differ diff --git a/res/content/base/sounds/steps/snow_0.ogg b/res/content/base/sounds/steps/snow_0.ogg index e50bd5fc..603946af 100644 Binary files a/res/content/base/sounds/steps/snow_0.ogg and b/res/content/base/sounds/steps/snow_0.ogg differ diff --git a/res/content/base/sounds/steps/snow_1.ogg b/res/content/base/sounds/steps/snow_1.ogg index c7409c15..8be6751e 100644 Binary files a/res/content/base/sounds/steps/snow_1.ogg and b/res/content/base/sounds/steps/snow_1.ogg differ diff --git a/res/content/base/sounds/steps/snow_2.ogg b/res/content/base/sounds/steps/snow_2.ogg index b4f44e98..415775bc 100644 Binary files a/res/content/base/sounds/steps/snow_2.ogg and b/res/content/base/sounds/steps/snow_2.ogg differ diff --git a/res/content/base/sounds/steps/snow_3.ogg b/res/content/base/sounds/steps/snow_3.ogg index 33f0161d..9e0a1c31 100644 Binary files a/res/content/base/sounds/steps/snow_3.ogg and b/res/content/base/sounds/steps/snow_3.ogg differ diff --git a/res/content/base/sounds/steps/snow_4.ogg b/res/content/base/sounds/steps/snow_4.ogg index 5ad40d6d..12f811ab 100644 Binary files a/res/content/base/sounds/steps/snow_4.ogg and b/res/content/base/sounds/steps/snow_4.ogg differ diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 67cdd0fe..9d29b873 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -194,8 +194,8 @@ function gui.template(name, params) text = text:gsub("if%s*=%s*'%%{%w+}'", "if=''") text = text:gsub("if%s*=%s*\"%%{%w+}\"", "if=\"\"") -- remove unsolved properties: attr='%{var}' - text = text:gsub("%w+%s*=%s*'%%{%w+}'%s?", "") - text = text:gsub("%w+%s*=%s*\"%%{%w+}\"%s?", "") + text = text:gsub("%s*%S+='%%{[^}]+}'%s*", " ") + text = text:gsub('%s*%S+="%%{[^}]+}"%s*', " ") return text end diff --git a/src/logic/scripting/lua/libs/libcore.cpp b/src/logic/scripting/lua/libs/libcore.cpp index cb5c7f43..80128971 100644 --- a/src/logic/scripting/lua/libs/libcore.cpp +++ b/src/logic/scripting/lua/libs/libcore.cpp @@ -148,7 +148,13 @@ static int l_reconfig_packs(lua::State* L) { lua::pop(L); } auto engineController = engine->getController(); - engineController->reconfigPacks(controller, addPacks, remPacks); + try { + engineController->reconfigPacks(controller, addPacks, remPacks); + } catch (const contentpack_error& err) { + throw std::runtime_error( + std::string(err.what()) + " [" + err.getPackId() + " ]" + ); + } return 0; } diff --git a/src/logic/scripting/lua/libs/libpack.cpp b/src/logic/scripting/lua/libs/libpack.cpp index 95bb9e99..5b3977a4 100644 --- a/src/logic/scripting/lua/libs/libpack.cpp +++ b/src/logic/scripting/lua/libs/libpack.cpp @@ -231,7 +231,13 @@ static int l_pack_assemble(lua::State* L) { } auto manager = engine->createPacksManager(worldFolder); manager.scan(); - ids = std::move(manager.assemble(ids)); + try { + ids = std::move(manager.assemble(ids)); + } catch (const contentpack_error& err) { + throw std::runtime_error( + std::string(err.what()) + " [" + err.getPackId() + "]" + ); + } lua::createtable(L, ids.size(), 0); for (size_t i = 0; i < ids.size(); i++) {